Module bp_config :: Class Config
[show private | hide private]
[frames | no frames]

Class Config

RawConfigParser --+    
                  |    
       ConfigParser --+
                      |
                     Config


Handle reading and writing various BitPim config values
Method Summary
  __init__(self, config_file_name)
Constructor
  Flush(self)
  HasEntry(self, key)
Check if the specified key exists.
  Read(self, key, default)
Read the value of keyword key, if that keyword does not exist, return default
  ReadFloat(self, key, default)
Read the value of keyword key, if that keyword does not exist, return default
  ReadInt(self, key, default)
Read the value of keyword key, if that keyword does not exist, return default
  Write(self, key, value)
Write the value of keyword key.
  WriteFloat(self, key, value)
Write the value of keyword key.
  WriteInt(self, key, value)
Write the value of keyword key.
    Inherited from ConfigParser
  get(self, section, option, raw, vars)
Get an option value for a given section.
  items(self, section, raw, vars)
Return a list of tuples with (name, value) for each option in the section.
    Inherited from RawConfigParser
  add_section(self, section)
Create a new section in the configuration.
  defaults(self)
  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.
  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
    Inherited from RawConfigParser
SRE_Pattern OPTCRE = ([^:=\s][^:=]*)\s*([:=])\s*(.*)$
SRE_Pattern SECTCRE = \[([^\]]+)\]

Method Details

__init__(self, config_file_name=None)
(Constructor)

Constructor
Parameters:
config_file_name - (optional) config file name
Overrides:
ConfigParser.RawConfigParser.__init__

HasEntry(self, key)

Check if the specified key exists.
Parameters:
key - key value
Returns:
True if key exists, False otherwise.

Read(self, key, default='')

Read the value of keyword key, if that keyword does not exist, return default
Parameters:
key - string key value.
default - default value if key does not exist.
Returns:
the value of key

ReadFloat(self, key, default=0.0)

Read the value of keyword key, if that keyword does not exist, return default
Parameters:
key - string key value.
default - default value if key does not exist.
Returns:
the value of key

ReadInt(self, key, default=0)

Read the value of keyword key, if that keyword does not exist, return default
Parameters:
key - string key value.
default - default value if key does not exist.
Returns:
the value of key

Write(self, key, value)

Write the value of keyword key.
Parameters:
key - string key value.
value - the value of the key.

WriteFloat(self, key, value)

Write the value of keyword key.
Parameters:
key - string key value.
value - the value of the key.

WriteInt(self, key, value)

Write the value of keyword key.
Parameters:
key - string key value.
value - the value of the key.

Generated by Epydoc 2.1 on Fri Aug 15 18:58:27 2008 http://epydoc.sf.net