Module config :: Class Container
[show private | hide private]
[frames | no frames]

Type Container

object --+
         |
        Container

Known Subclasses:
Mapping, Sequence

This internal class is the base class for mappings and sequences.
Method Summary
  __init__(self, parent)
Initialize an instance.
  evaluate(self, item)
Evaluate items which are instances of Reference or Expression.
  setPath(self, path)
Set the path for this instance.
  writeToStream(self, stream, indent, container)
Write this instance to a stream at the specified indentation level.
  writeValue(self, value, stream, indent)
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
Return hash(x)...
  __new__(T, S, ...)
Return a new object with type S, a subtype of T...
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
Return repr(x)...
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
Return str(x)...

Instance Variable Summary
  path: A string which describes how to get to this instance from the root of the hierarchy.

Method Details

__init__(self, parent)
(Constructor)

Initialize an instance.
Parameters:
parent - The parent of this instance in the hierarchy.
           (type=A Container instance.)
Overrides:
__builtin__.object.__init__

evaluate(self, item)

Evaluate items which are instances of Reference or Expression.

Reference instances are evaluated using Reference.resolve, and Expression instances are evaluated using Expression.evaluate.
Parameters:
item - The item to be evaluated.
           (type=any)
Returns:
If the item is an instance of Reference or Expression, the evaluated value is returned, otherwise the item is returned unchanged.

setPath(self, path)

Set the path for this instance.
Parameters:
path - The path - a string which describes how to get to this instance from the root of the hierarchy.
           (type=str)

writeToStream(self, stream, indent, container)

Write this instance to a stream at the specified indentation level.

Should be redefined in subclasses.
Parameters:
stream - The stream to write to
           (type=A writable stream (file-like object))
indent - The indentation level
           (type=int)
container - The container of this instance
           (type=Container)
Raises:
NotImplementedError - If a subclass does not override this

writeValue(self, value, stream, indent)


Instance Variable Details

path

A string which describes how to get to this instance from the root of the hierarchy.

Example:
   a.list.of[1].or['more'].elements