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

Class Section

source code

object --+
         |
        Section

Config section container
Instance Methods [hide private]
 
__init__(self)
Initialization
source code
 
__iter__(self)
(Name, Value) tuple iterator
source code
 
__setitem__(self, name, value)
Set a new option
source code
any
__getitem__(self, name)
Return a config option by key
source code
 
__delitem__(self, name)
Delete option
source code
any
__getattr__(self, name)
Get option in dotted notation
source code
any
__call__(self, name, default=None)
Get option or default value
source code
bool
__contains__(self, name)
Determine whether name is an available option key
source code

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

Instance Variables [hide private]
dict __section_options__
Option dict
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 
Initialization
Overrides: object.__init__

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

source code 
Set a new option
Parameters:
  • name (unicode) - Option name
  • value (any) - Option value

__getitem__(self, name)
(Indexing operator)

source code 
Return a config option by key
Parameters:
  • name (unicode) - The key to look up
Returns: any
The value of the option
Raises:
  • KeyError - No suitable option could be found

__delitem__(self, name)
(Index deletion operator)

source code 
Delete option
Parameters:
  • name (unicode) - Option key to process
Raises:
  • KeyError - Option did not exist

__getattr__(self, name)
(Qualification operator)

source code 
Get option in dotted notation
Parameters:
  • name (str) - Option key to look up
Returns: any
The value of the option
Raises:
  • AttributeError - No suitable option could be found

__call__(self, name, default=None)
(Call operator)

source code 
Get option or default value
Parameters:
  • name (unicode) - The option key to look up
  • default (any) - Default value
Returns: any
The value of the option

__contains__(self, name)
(In operator)

source code 
Determine whether name is an available option key
Parameters:
  • name (unicode) - The option key to look up
Returns: bool
Is name an available option?