ConfigParser
 

Configuration file parser.

A setup file consists of sections, lead by a "[section]" header,
and followed by "name: value" entries, with continuations and such in
the style of RFC 822.

The option values can contain format strings which refer to other values in
the same section, or values in a special [DEFAULT] section.

For example:

    something: %(dir)s/whatever

would resolve the "%(dir)s" to the value of dir.  All reference
expansions are done late, on demand.

Intrinsic defaults can be specified by passing them into the
ConfigParser constructor as a dictionary.

class:

ConfigParser -- responsible for for parsing a list of
                configuration files, and managing the parsed database.

    methods:

    __init__(defaults=None)
        create the parser and specify a dictionary of intrinsic defaults.  The
        keys must be strings, the values must be appropriate for %()s string
        interpolation.  Note that `__name__' is always an intrinsic default;
        it's value is the section's name.

    sections()
        return all the configuration section names, sans DEFAULT

    options(section)
        return list of configuration options for the named section

    read(filenames)
        read and parse the list of named configuration files

    get(section, option, raw=0, vars=None)
        return a string value for the named option.  All % interpolations are
        expanded in the return values, based on the defaults passed into the
        constructor and the DEFAULT section.  Additional substitutions may be
        provided using the `vars' argument, which must be a dictionary whose
        contents override any pre-existing defaults.

    getint(section, options)
        like get(), but convert value to an integer

    getfloat(section, options)
        like get(), but convert value to a float

    getboolean(section, options)
        like get(), but convert value to a boolean (currently defined as 0 or
        1, only)


 Modules
                                                                                                                                                                                                                               
re
string
sys


 Classes
                                                                                                                                                                                                                               
ConfigParser
Error
DuplicateSectionError
InterpolationError
MissingSectionHeaderError
NoOptionError
NoSectionError
ParsingError


 class ConfigParser
           no doc string
                                                                                                                                                                                                                     
__get(self, section, conv, option)
no doc string
__read(self, fp)
Parse a sectioned setup file.
The sections in setup file contains a title line at the top,
indicated by a name in square brackets (`[]'), plus key/value
options lines, indicated by `name: value' format lines.
Continuation are represented by an embedded newline then
leading whitespace.  Blank lines, lines beginning with a '#',
and just about everything else is ignored.
__init__(self, defaults=None)
no doc string
add_section(self, section)
Create a new section in the configuration.
Raise DuplicateSectionError if a section by the specified name
already exists.
defaults(self)
no doc string
get(self, section, option, raw=0, vars=None)
Get an option value for a given section.
All % interpolations are expanded in the return values, based on the
defaults passed into the constructor, unless the optional argument
`raw' is true.  Additional substitutions may be provided using the
`vars' argument, which must be a dictionary whose contents overrides
any pre-existing defaults.
The section DEFAULT is special.
getboolean(self, section, option)
no doc string
getfloat(self, section, option)
no doc string
getint(self, section, option)
no doc string
has_section(self, section)
Indicate whether the named section is present in the configuration.
The DEFAULT section is not acknowledged.
options(self, section)
no doc string
read(self, filenames)
Read and parse a list of filenames.
sections(self)
Return a list of section names, excluding [DEFAULT]


 class DuplicateSectionError(Error)
           no doc string
                                                                                                                                                                                                                     
__init__(self, section)
no doc string


 class Error
           # exception classes
 
                                                                                                                                                                                                                     
__init__(self, msg='')
no doc string
__repr__(self)
no doc string


 class InterpolationError(Error)
           no doc string
                                                                                                                                                                                                                     
__init__(self, reference, option, section, rawval)
no doc string


 class MissingSectionHeaderError(Error)
           no doc string
                                                                                                                                                                                                                     
__init__(self, filename, lineno, line)
no doc string


 class NoOptionError(Error)
           no doc string
                                                                                                                                                                                                                     
__init__(self, option, section)
no doc string


 class NoSectionError(Error)
           no doc string
                                                                                                                                                                                                                     
__init__(self, section)
no doc string


 class ParsingError(Error)
           no doc string
                                                                                                                                                                                                                     
__init__(self, filename)
no doc string
append(self, lineno, line)
no doc string