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

Class Config

source code

ConfigParser.RawConfigParser --+    
                               |    
       ConfigParser.ConfigParser --+
                                   |
                                  Config

Handle reading and writing various BitPim config values

Instance Methods [hide private]
 
__init__(self, config_file_name=None)
Constructor
source code
 
_getdefaults(self) source code
 
_expand(self, key) source code
 
_check_section(self, section) source code
 
Read(self, key, default='')
Read the value of keyword key, if that keyword does not exist, return default
source code
 
ReadInt(self, key, default=0)
Read the value of keyword key, if that keyword does not exist, return default
source code
 
ReadFloat(self, key, default=0.0)
Read the value of keyword key, if that keyword does not exist, return default
source code
 
Write(self, key, value)
Write the value of keyword key.
source code
 
WriteInt(self, key, value)
Write the value of keyword key.
source code
 
WriteFloat(self, key, value)
Write the value of keyword key.
source code
 
HasEntry(self, key)
Check if the specified key exists.
source code
 
Flush(self) source code

Inherited from ConfigParser.ConfigParser: get, items

Inherited from ConfigParser.ConfigParser (private): _interpolate, _interpolation_replace

Inherited from ConfigParser.RawConfigParser: add_section, defaults, getboolean, getfloat, getint, has_option, has_section, options, optionxform, read, readfp, remove_option, remove_section, sections, set, write

Inherited from ConfigParser.RawConfigParser (private): _get, _read

Class Variables [hide private]
  _default_config_filename = '.bitpim'

Inherited from ConfigParser.ConfigParser (private): _KEYCRE

Inherited from ConfigParser.RawConfigParser: OPTCRE, SECTCRE

Inherited from ConfigParser.RawConfigParser (private): _boolean_states

Method Details [hide private]

__init__(self, config_file_name=None)
(Constructor)

source code 

Constructor

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

Read(self, key, default='')

source code 

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)

source code 

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)

source code 

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)

source code 

Write the value of keyword key.

Parameters:
  • key - string key value.
  • value - the value of the key.

WriteInt(self, key, value)

source code 

Write the value of keyword key.

Parameters:
  • key - string key value.
  • value - the value of the key.

WriteFloat(self, key, value)

source code 

Write the value of keyword key.

Parameters:
  • key - string key value.
  • value - the value of the key.

HasEntry(self, key)

source code 

Check if the specified key exists.

Parameters:
  • key - key value
Returns:
True if key exists, False otherwise.