Package wtf :: Module config :: Class Config
[hide private]
[frames] | no frames]

Class Config

source code

object --+
         |
        Config

Config access class
Instance Methods [hide private]
 
__init__(self, root)
Initialization
source code
 
__iter__(self)
Return (sectionname, section) tuples of parsed sections
source code
 
__setitem__(self, name, value)
Set a section
source code
Section
__getitem__(self, name)
Get section by key
source code
bool
__contains__(self, name)
Determine if a section named name exists
source code
Section
__getattr__(self, name)
Return section by dotted notation
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]
str ROOT
The current working directory at startup time
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, root)
(Constructor)

source code 
Initialization
Parameters:
  • root (str) - The current working directory at startup time
Overrides: object.__init__

__setitem__(self, name, value)
(Index assignment operator)

source code 
Set a section
Parameters:
  • name (unicode) - Section name
  • value (Section) - Section instance

__getitem__(self, name)
(Indexing operator)

source code 
Get section by key
Parameters:
  • name (basestring) - The section name
Returns: Section
Section object
Raises:
  • KeyError - section not found

__contains__(self, name)
(In operator)

source code 
Determine if a section named name exists
Parameters:
  • name (unicode) - The section name
Returns: bool
Does the section exist?

__getattr__(self, name)
(Qualification operator)

source code 
Return section by dotted notation
Parameters:
  • name (str) - The section name
Returns: Section
Section object
Raises:
  • AttributeError - section not found