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

Type Sequence

object --+    
         |    
 Container --+
             |
            Sequence


This internal class implements a value which is a sequence of other values.
Method Summary
  __init__(self, parent)
Initialize an instance.
  __getitem__(self, index)
  __iter__(self)
  __len__(self)
  __repr__(self)
  __str__(self)
  append(self, item, comment)
Add an item to the sequence.
  save(self, stream, indent)
Save this instance to the specified stream.
  writeToStream(self, stream, indent, container)
Write this instance to a stream at the specified indentation level.
    Inherited from Container
  evaluate(self, item)
Evaluate items which are instances of Reference or Expression.
  setPath(self, path)
Set the path for this instance.
  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
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value

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

Class Variable Summary
type SeqIter = config.SeqIter

Method Details

__init__(self, parent=None)
(Constructor)

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

__getitem__(self, index)
(Indexing operator)

__iter__(self)

__len__(self)
(Length operator)

__repr__(self)
(Representation operator)

Overrides:
__builtin__.object.__repr__

__str__(self)
(Informal representation operator)

Overrides:
__builtin__.object.__str__

append(self, item, comment)

Add an item to the sequence.
Parameters:
item - The item to add.
           (type=any)
comment - A comment for the item.
           (type=str)

save(self, stream, indent)

Save this instance to the specified stream.
Parameters:
stream - A stream to which the configuration is written.
           (type=A write-only stream (file-like object).)
indent - The indentation level for the output, > 0
           (type=int)

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)
Overrides:
config.Container.writeToStream