![]() |
App Engine Python SDK
v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
|
Public Member Functions | |
def | __init__ |
def | __str__ |
def | __deepcopy__ |
def | __len__ |
def | __nonzero__ |
def | __contains__ |
def | add |
def | negate |
def | start_subtree |
def | end_subtree |
Public Attributes | |
children | |
connector | |
subtree_parents | |
negated | |
Static Public Attributes | |
string | default = 'DEFAULT' |
A single internal node in the tree graph. A Node should be viewed as a connection (the root) with the children being either leaf nodes or other Node instances.
def google.appengine._internal.django.utils.tree.Node.__init__ | ( | self, | |
children = None , |
|||
connector = None , |
|||
negated = False |
|||
) |
Constructs a new Node. If no connector is given, the default will be used. Warning: You probably don't want to pass in the 'negated' parameter. It is NOT the same as constructing a node and calling negate() on the result.
def google.appengine._internal.django.utils.tree.Node.__contains__ | ( | self, | |
other | |||
) |
Returns True is 'other' is a direct child of this instance.
def google.appengine._internal.django.utils.tree.Node.__deepcopy__ | ( | self, | |
memodict | |||
) |
Utility method used by copy.deepcopy().
def google.appengine._internal.django.utils.tree.Node.__len__ | ( | self | ) |
The size of a node if the number of children it has.
def google.appengine._internal.django.utils.tree.Node.__nonzero__ | ( | self | ) |
For truth value testing.
def google.appengine._internal.django.utils.tree.Node.add | ( | self, | |
node, | |||
conn_type | |||
) |
Adds a new node to the tree. If the conn_type is the same as the root's current connector type, the node is added to the first level. Otherwise, the whole tree is pushed down one level and a new root connector is created, connecting the existing tree and the new node.
def google.appengine._internal.django.utils.tree.Node.end_subtree | ( | self | ) |
Closes off the most recently unmatched start_subtree() call. This puts the current state into a node of the parent tree and returns the current instances state to be the parent.
def google.appengine._internal.django.utils.tree.Node.negate | ( | self | ) |
Negate the sense of the root connector. This reorganises the children so that the current node has a single child: a negated node containing all the previous children. This slightly odd construction makes adding new children behave more intuitively. Interpreting the meaning of this negate is up to client code. This method is useful for implementing "not" arrangements.
def google.appengine._internal.django.utils.tree.Node.start_subtree | ( | self, | |
conn_type | |||
) |
Sets up internal state so that new nodes are added to a subtree of the current node. The conn_type specifies how the sub-tree is joined to the existing children.