|
From: <tom...@gm...> - 2006-09-09 23:54:23
|
Michael Foord wrote: > Tomi Kyöstilä wrote: >> Hi! >> >> Is it possible to spread lists over multiple lines in ConfigObj? >> >> For example, this one-line list >> >> asd = foo, bar, baz >> >> would be written as >> >> asd = foo, >> bar, >> baz >> >> When I try that, I get a parse error. It would make managing the >> config files easier when it contains long lists. > This feature would be very cool, but also quite tricky to implement. :-) > > If you are able to do it without making the parser even harder to read, > I would welcome the patch... So I've put together a patch in the last four hours and it works well enough for my needs. I've made just a few test cases so there might very well be something wrong with it that I haven't thought of. It doesn't work with unrepr mode (I don't really need that feature, I just tried this with it), but is it even possible to change the parsing in that mode since it uses the compiler package? I've attached the patch to this message (don't know if attachments are allowed) and you can also get the patch from http://fout.dy.fi/~tomik/configobj-multiline_lists.patch for now. Fuzzyman, do you want me to upload it to SourceForge? I hesitated because the patch area seems a bit empty at the moment :). Please let me know if you find something wrong with it. -- Tomi Kyöstilä > > Fuzzyman > http://www.voidspace.org.uk/python/index.shtml > >> >> -- >> Tomi Kyöstilä |