[Web-SIG] ConfigParser for configuration

Chris Withers chris at simplistix.co.uk
Tue Mar 13 15:08:18 CET 2007


Fred Drake wrote:
> On 3/9/07, Chris Withers <chris at simplistix.co.uk> wrote:
>> You have free reign now, right? ;-)
> 
> Heh.  Compatibility is worth something, even to me.

Oh just BBB it ;-)

> The application itself has to understand that it's creating an
> arbitrarily nested structure from a simple (two-level) hierarchy.  How
> that happens is part of the application, not a magical helper library.

Funny, I always appreciated the help from the not-so-magical library. 
Saves a lot of wheel re-inventing when doing config for various projects...

> If you really want to use logging.config.fileConfig(), I'd suggest
> your app having something like "logging-configuration =
> /path/to/logging/config.ini", and using that to call the logging
> configuration with the indicated file.

OK.

>> Can one config.ini include other .ini files in the same way ZConfig 
>> allows?
> 
> No.

:-/

> What this needs to be depends on the application.  There's a simple
> layering included in ConfigParser (call read() with multiple
> filenames, or readfp() more than once), but that doesn't serve
> zc.buildout well.  You can look in the zc.buildout documentation and
> code for what that does; look for "extends".

Ah, I think I'm getting the picture now.
So, basically, everything ends up in one dictionary, and you need to be 
careful nothing re-uses a key?

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the Web-SIG mailing list