[Zconfig] Overlaying multiple config files

Barry Warsaw barry at zope.com
Mon Apr 26 13:13:14 EDT 2004


On Mon, 2004-04-26 at 10:09, Moore, Paul wrote:

> As an alternative way of getting what I want, can sections of a config
> file "override" each other? I'll give an example:
> 
> <database>
> username general_user
> password secret
> connect my_db.my_server
> </database>
> 
> <app1>
>     <database>
>     username app1_user
>     password secret2
>     </database>
> </app1>
> 
> The idea being that any application can use config.database.username to
> get at the username to use. But app1 can say (somehow) that it expects
> the app1 section to override the information in the base section.

That's a neat idea and I've had similar use cases.  I've wanted to set
up a 'default' section, with overrides.  I actually figured out a
different less-flexible way of doing what I wanted, but I'd love a more
natural ZConfig way of doing it.

-Barry





More information about the ZConfig mailing list