[Web-SIG] Config system

Ian Bicking ianb at colorstudy.com
Sun Nov 28 21:19:11 CET 2004


Dave Warnock wrote:
>> I've been doing some more work on a config file loader, part of 
>> WSGIKit: svn://colorstudy.com/trunk/WSGIKit
>>
>> It's in wsgikit.config -- lazyloader in particular.
>>
>> It has some features that I think are useful:
> 
> 
> Sounds cool. My feeling is that we should have a defined standard 
> behaviour (format of configuration file, consistent appearance of the 
> results inside a wsgi application etc) and then allow a variety of 
> implementations.

I don't really know if it's meaningful to have multiple implementations 
unless they each have some reason for existing.  With WSGI there's 
obviously a reason for multiple implementations.  I'm having a hard time 
seeing what meaningful alternate implementations there would be for this.

Well, I can imagine other config file formats, like XML.  There's no 
hooks for adding a new parser, but it should really be fairly easy. 
There's actually several XML formats I could imagine, depending on how 
uniform a schema you want (Java configs being on the uniform end).

But other formats would be harder.  For instance, YAML is typed (i.e., a 
configuration value becomes an integer or a string at parse time), which 
doesn't really work with the rest of the system.  (Something that looks 
like YAML but doesn't deal with types would be okay.)  I'm not sure 
about ZConfig.

In many ways, the semantics and features of this system require the 
implementation to look like it does.  You could change trivial parts -- 
for instance, the way configuration keys are split up for creating 
hierarchies, or how sections relate to the keys contained in them -- but 
those aren't the interesting or challenging parts (IMHO).

Alternatively, we could define configuration abstractly enough that 
multiple novel implementations would be possible.  But I'm not sure that 
is actually possible.

> So can what you and Phillip are doing and merge out of that something so 
> that the choice of config implementation does not require changing 
> configuration file or application.
> 
> By the way your webserver at colorstudy seems to be down.

Yeah, I haven't been able to install PyCS on my new server, so I'm 
trying to set up a new blog system I've been thinking about, of which 
configuration is a part ;)

-- 
Ian Bicking  /  ianb at colorstudy.com  / http://blog.ianbicking.org


More information about the Web-SIG mailing list