|
__init__(self,
nid=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
source code
|
|
|
|
|
|
|
|
|
|
|
insert(self,
index,
child)
insert a child node |
source code
|
|
|
replace(self,
old_child,
new_child)
replace a child node with another |
source code
|
|
|
get_sibling(self,
nid)
return the sibling node that has given id |
source code
|
|
|
next_sibling(self)
return the next sibling for this node if any |
source code
|
|
|
previous_sibling(self)
return the previous sibling for this node if any |
source code
|
|
|
get_node_by_id(self,
nid)
return node in whole hierarchy that has given id |
source code
|
|
|
get_child_by_id(self,
nid,
recurse=None)
return child of given id |
source code
|
|
|
get_child_by_path(self,
path)
return child of given path (path is a list of ids) |
source code
|
|
|
depth(self)
return depth of this node in the tree |
source code
|
|
|
depth_down(self)
return depth of the tree from this node |
source code
|
|
|
width(self)
return the width of the tree from this node |
source code
|
|
|
root(self)
return the root node of the tree |
source code
|
|
|
leaves(self)
return a list with all the leaves nodes descendant from this node |
source code
|
|
|
|
|
flatten(self,
_list=None)
return a list with all the nodes descendant from this node |
source code
|
|
|
lineage(self)
return list of parents up to root node |
source code
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__subclasshook__
|