Trees | Indices | Help |
|
---|
|
Iterable class of nodes with node ranges support. NodeSet creation examples: nodeset = NodeSet() # empty NodeSet nodeset = NodeSet("clustername3") # contains only clustername3 nodeset = NodeSet("clustername[5,10-42]") nodeset = NodeSet("clustername[0-10/2]") nodeset = NodeSet("clustername[0-10/2],othername[7-9,120-300]") NodeSet provides methods like update(), intersection_update() or difference_update() methods, which conform to the Python Set API. However, unlike RangeSet or standard Set, NodeSet is somewhat not so strict for convenience, and understands NodeSet instance or NodeSet string as argument. Also, there is no strict definition of one element, for example, it IS allowed to do: nodeset.remove("blue[36-40]").
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
|
|
|||
Inherited from |
|
Initialize a NodeSet. If no pattern is specified, an empty NodeSet is created.
|
Get pdsh-like, ranges-based pattern of node list.
|
Return the node at index i. For convenience only, not optimized as of version 1.0. |
Return the slice from index i to index j-1. For convenience only, not optimized as of version 1.0. |
Split the nodeset into nbr sub-nodeset. Each sub-nodeset will have the same number of element more or less 1. Current nodeset remains unmodified. >>> NodeSet("foo[1-5]").split(3) NodeSet("foo[1-2]") NodeSet("foo[3-4]") NodeSet("foo5") |
Implements the | operator. So s | t returns a new nodeset with elements from both s and t. |
Implements the |= operator. So s |= t returns nodeset s with elements added from t. (Python version 2.5+ required) |
Implements the & operator. So s & t returns a new nodeset with elements common to s and t. |
Implements the &= operator. So s &= t returns nodeset s keeping only elements also found in t. (Python version 2.5+ required) |
Implement the - operator. So s - t returns a new nodeset with elements in s but not in t. |
s.difference_update(t) returns nodeset s after removing elements found in t. If strict is True, raise KeyError if an element cannot be removed. |
Implement the -= operator. So s -= t returns nodeset s after removing elements found in t. (Python version 2.5+ required) |
Remove element elem from the nodeset. Raise KeyError if elem is not contained in the nodeset. |
s.symmetric_difference(t) returns the symmetric difference of two nodesets as a new NodeSet. (ie. all nodes that are in exactly one of the nodesets.) |
Implement the ^ operator. So s ^ t returns a new NodeSet with nodes that are in exactly one of the nodesets. |
Implement the ^= operator. So s ^= t returns nodeset s after keeping all nodes that are in exactly one of the nodesets. (Python version 2.5+ required) |
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Mar 9 10:46:34 2010 | http://epydoc.sourceforge.net |