|
From: Etienne R. <er...@gt...> - 2010-06-22 22:12:19
|
Hi Michael, Thanks for your input! I like the idea of defaults settings too. This makes packages that needs configuration files to override only the desired settings. However, as you pointed out, my use case is hairy and my development.ini needs some refactoring as its having a tendency to accumulate too many sections. Shorter config files would be best. Thus, a include statement would include all config items and merge them in a Section instance. I will look for doing a patch as this seems a easy fix.. Michael Foord wrote: > On 21/06/2010 11:35, Etienne Robillard wrote: >> Hi, >> >> would there be any way to include config files from within >> a config section ? >> >> I would like doing the following: >> >> [item1] >> include path/to/item1.ini >> >> > > Configobj doesn't currently include any way to "include" sub config > files - although it does have programmatic support for merging them > (see the merge method). > >> Although this seems to break the current RFC-822 rule >> > > Configobj isn't bound by rfc-822 anyway. :-) > >> for config files section as this statement is missing the equal >> syntax control block. However, this would be a great way >> to make ConfigObj even more powerful; allowing config items to recycle >> common config items. Would there be a better way to include shared >> config items with ConfigObj ? >> > > Hmmm... I prefer defaults, which obviously doesn't meet all use cases. > I'm not sure about this - there are lots of (over the years) different > feature requests for cross-referencing, including files, a heirarchy > of config files and so on. No single proposal strikes me as > particularly elegant nor meets *all* the use cases. > > I'm open to patches (with tests and documentation of course), but this > isn't an itch I particularly feel like scratching myself. No problem, I'll handle and report here once i find some time to investigate configobj! ;) > All the best, > > Michael Foord > Cheers, E -- Etienne Robillard Software developer Green Tea Hackers Club E-mail: er...@gt... Work phone: (514) 962-7703 Website: https://gthc.org/ During times of universal deceit, telling the truth becomes a revolutionary act. -- George Orwell |