Module ConfigParser :: Class RawConfigParser
[show private | hide private]
[frames | no frames]

Class RawConfigParser

Known Subclasses:
ConfigParser

Method Summary
  __init__(self, defaults)
  add_section(self, section)
Create a new section in the configuration.
  defaults(self)
  get(self, section, option)
  getboolean(self, section, option)
  getfloat(self, section, option)
  getint(self, section, option)
  has_option(self, section, option)
Check for the existence of a given option in a given section.
  has_section(self, section)
Indicate whether the named section is present in the configuration.
  items(self, section)
  options(self, section)
Return a list of option names for the given section name.
  optionxform(self, optionstr)
  read(self, filenames)
Read and parse a filename or a list of filenames.
  readfp(self, fp, filename)
Like read() but the argument must be a file-like object.
  remove_option(self, section, option)
Remove an option.
  remove_section(self, section)
Remove a file section.
  sections(self)
Return a list of section names, excluding [DEFAULT]
  set(self, section, option, value)
Set an option.
  write(self, fp)
Write an .ini-format representation of the configuration state.

Class Variable Summary
SRE_Pattern OPTCRE = ([^:=\s][^:=]*)\s*([:=])\s*(.*)$
SRE_Pattern SECTCRE = \[([^\]]+)\]

Method Details

add_section(self, section)

Create a new section in the configuration.

Raise DuplicateSectionError if a section by the specified name already exists.

has_option(self, section, option)

Check for the existence of a given option in a given section.

has_section(self, section)

Indicate whether the named section is present in the configuration.

The DEFAULT section is not acknowledged.

options(self, section)

Return a list of option names for the given section name.

read(self, filenames)

Read and parse a filename or a list of filenames.

Files that cannot be opened are silently ignored; this is designed so that you can specify a list of potential configuration file locations (e.g. current directory, user's home directory, systemwide directory), and all existing configuration files in the list will be read. A single filename may also be given.

Return list of successfully read files.

readfp(self, fp, filename=None)

Like read() but the argument must be a file-like object.

The `fp' argument must have a `readline' method. Optional second argument is the `filename', which if not given, is taken from fp.name. If fp has no `name' attribute, `<???>' is used.

remove_option(self, section, option)

Remove an option.

remove_section(self, section)

Remove a file section.

sections(self)

Return a list of section names, excluding [DEFAULT]

set(self, section, option, value)

Set an option.

write(self, fp)

Write an .ini-format representation of the configuration state.

Class Variable Details

OPTCRE

Type:
SRE_Pattern
Value:
([^:=\s][^:=]*)\s*([:=])\s*(.*)$                                       

SECTCRE

Type:
SRE_Pattern
Value:
\[([^\]]+)\]                                                           

Generated by Epydoc 2.1 on Sat Mar 4 13:36:22 2006 http://epydoc.sf.net