Package mrv :: Module conf :: Class ConfigNode
[hide private]
[frames] | no frames]

Class ConfigNode

source code

object --+
         |
        ConfigNode

Represents node in the configuration chain

It keeps information about the origin of the configuration and all its data. Additionally, it is aware of it being element of a chain, and can provide next and previous elements respectively

Instance Methods [hide private]
 
_isWritable(self) source code
 
_update(self, configparser)
Update our data with data from configparser
source code
 
parse(self)
parse default INI information into the extended structure
source code
 
write(self, rcp, close_fp=True)
Write our contents to our file-like object
source code

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

    Construction/Destruction
 
__init__(self, fp)
Initialize Class Instance
source code
    Section Access
 
listSections(self)
Returns: list() with string names of available sections
source code
 
section(self, name)
Returns: Section with name
source code
 
hasSection(self, name)
Returns: True if the given section exists
source code
 
sectionDefault(self, name)
Returns: Section with name, create it if required
source code
Class Methods [hide private]
 
_check_and_append(cls, sectionsforwriting, section)
Assure we ignore empty sections
source code
Properties [hide private]
  _fp
  _sections

Inherited from object: __class__

    Properties
  writable
Method Details [hide private]

__init__(self, fp)
(Constructor)

source code 
Initialize Class Instance
Overrides: object.__init__

parse(self)

source code 

parse default INI information into the extended structure

Parse the given INI file using a _FixedConfigParser, convert all information in it into an internal format

Raises:

_check_and_append(cls, sectionsforwriting, section)
Class Method

source code 
Assure we ignore empty sections
Returns:
True if section has been appended, false otherwise

write(self, rcp, close_fp=True)

source code 
Write our contents to our file-like object
Parameters:
  • rcp - RawConfigParser to use for writing
Returns:
the name of the written file
Raises:
  • IOError - if we are read-only

listSections(self)

source code 
Returns:
list() with string names of available sections

To Do: return an iterator instead

section(self, name)

source code 
Returns:
Section with name
Raises:
  • NoSectionError

hasSection(self, name)

source code 
Returns:
True if the given section exists

sectionDefault(self, name)

source code 
Returns:
Section with name, create it if required

Property Details [hide private]

writable

Get Method:
_isWritable(self)