Package gavo :: Package utils :: Module autonode :: Class AutoNode
[frames] | no frames]

Class AutoNode

source code

object --+
         |
        AutoNode
Known Subclasses:

An AutoNode.

AutoNodes are explained in AutoNode's metaclass, AutoNodeType.

A noteworthy method is change -- pass in new attribute values to create a new instance with the original attribute values except for those passed to change. This will only work if all non-autoattribute attributes of the class are set in _setupNode.

Nested Classes
  __metaclass__
A metaclass for AutoNodes..
Instance Methods
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__repr__(self)
repr(x)
source code
 
change(self, **kwargs)
returns a shallow copy of self with constructor arguments in kwargs changed.
source code
 
iterAttributes(self, skipEmpty=False)
yields pairs of attributeName, attributeValue for this node.
source code
 
iterChildren(self, skipEmpty=False) source code
 
iterNodeChildren(self)
yields pairs of attributeName, attributeValue for this node.
source code
 
iterNodes(self)
iterates the tree preorder.
source code

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

Class Methods
 
cloneFrom(cls, other, **kwargs)
returns a shallow clone of other.
source code
Properties

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

cloneFrom(cls, other, **kwargs)
Class Method

source code 

returns a shallow clone of other.

other should be of the same class or a superclass.

iterNodeChildren(self)

source code 

yields pairs of attributeName, attributeValue for this node.

This will look into sequences, so multiple occurrences of an attributeName are possible. Only nodes are returned.

iterNodes(self)

source code 

iterates the tree preorder.

Only AutoNodes are returned, not python values.