ANN: New configuration module released
Neal Becker
ndbecker2 at verizon.net
Wed Nov 3 18:47:35 EST 2004
Vinay Sajip wrote:
> Neal D. Becker wrote:
>> Looks good so far.
>>
>> The boost c++ library (about to be released) has a new program_options
>> parser. One feature I appreciate in the design, is that the source of
>> options is seperated from the rest of the design. This means that, out
>> of the box, it reads options from command line, from config files, and
>> from
>> env variables. Probably not hard to extend if anyone could think of a
>> reason.
>>
>> I believe a decent config module should at least handle both config files
>> and command line options. ENV variables are a nice touch too.
>>
>
> Python already has the optparse module for command-line options, and
> it's pretty good. I'll be looking at ways in which access to
> command-line options parsed via optparse can be made available through
> the config API, without duplication of code.
>
The point is, you would like to specify the options once, and use this
single specification for all option sources - instead of redundantly having
to specify that there is a 'verbosity' option that takes a value of 'int'
and has a default of 'whatever', and do this once (and with different
syntax) for each source - config files, command line, etc.
More information about the Python-list
mailing list