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

Class ConfigChain

source code

object --+    
         |    
      list --+
             |
            ConfigChain

A chain of config nodes

This utility class keeps several ConfigNode objects, but can be operated like any other list.


Note: this solution is mainly fast to implement, but a linked-list like behaviour is intended

Instance Methods [hide private]

Inherited from list: __add__, __contains__, __delitem__, __delslice__, __eq__, __ge__, __getattribute__, __getitem__, __getslice__, __gt__, __iadd__, __imul__, __iter__, __le__, __len__, __lt__, __mul__, __ne__, __new__, __repr__, __reversed__, __rmul__, __setitem__, __setslice__, __sizeof__, count, index, pop, remove, reverse

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __str__, __subclasshook__

    List Overridden Methods
new empty list
__init__(self)
Assures we can only create plain instances
source code
 
append(self, node)
Append a ConfigNode
source code
 
insert(self, node, index)
Insert L?{ConfigNode} before index
source code
 
extend(self, *args, **kwargs)
extend list by appending elements from the iterable
source code
 
sort(self, *args, **kwargs)
stable sort *IN PLACE*; cmp(x, y) -> -1, 0, 1
source code
    Iterators
 
sectionIterator(self)
Returns: section iterator for whole configuration chain
source code
 
keyIterator(self)
Returns: iterator returning tuples of (key,section) pairs
source code
 
iterateKeysByName(self, name)
Returns: Iterator yielding (Key,`Section`) of key matching name found in section
source code
Class Methods [hide private]
    List Overridden Methods
 
_checktype(cls, node) source code
Class Variables [hide private]

Inherited from list: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 
Assures we can only create plain instances
Returns: new empty list
Overrides: object.__init__

append(self, node)

source code 
Append a ConfigNode
Overrides: list.append

insert(self, node, index)

source code 
Insert L?{ConfigNode} before index
Overrides: list.insert

extend(self, *args, **kwargs)

source code 

extend list by appending elements from the iterable

Raises:
  • NotImplementedError
Overrides: list.extend

sort(self, *args, **kwargs)

source code 

stable sort *IN PLACE*; cmp(x, y) -> -1, 0, 1

Raises:
  • NotImplementedError
Overrides: list.sort

sectionIterator(self)

source code 
Returns:
section iterator for whole configuration chain

keyIterator(self)

source code 
Returns:
iterator returning tuples of (key,section) pairs

iterateKeysByName(self, name)

source code 
Parameters:
  • name - the name of the key you wish to find
Returns:
Iterator yielding (Key,`Section`) of key matching name found in section