thoughts on a bzrrc file

Wilk wilk-ml at flibuste.net
Fri May 20 19:24:32 BST 2005


Hi,

I think (i don't use it now) that cfgparse could answer all the
questions, it will not add a big dependency since it's only one single
file and candidat to standard-lib.

http://cfgparse.sourceforge.net/cfgparse.html

Standard Features

    * Simple ini style configuration syntax
    * Type checking with error handling and help messages
    * Help summary modelled after that in optparse
    * Round trip - read, modify, write configuration files with comment retention
    * Cooperates with optparse for configuration file options that should be overridden by command line options

Advanced Features

    * Supports heirarchically organized option settings
          o User may store multiple option settings in a arbitrarily deep keyed dictionary.
          o Application uses a key list to walk into the dictionary to obtain a setting.
          o User controls key list with setting in configuration file.
          o Supports adding keys to the list through a command line option or from environment variables.
    * Supports allowing user control of configuration files used.
          o Environment variables may be used to allow user to specify a default configuration file.
          o Command line options to specify configuration file supported.
          o Configuration files may include other configuration files where where sections are read in parallel.
          o Configuration files may be nested heirarchically by including configuration files from within a section or subsection.
    * Configuration files may alternatively be written in Python.
          o full power and flexibility of Python available for creation of option settings
          o allows options settings to be real Python objects
          o this feature is NOT enabled by default
    * May be extended to support syntax such as XML.


-- 
William - http://flibuste.net





More information about the bazaar mailing list