A graph of objects that have a “graphident” attribute. The value of this attribute is the key for the object in the graph.
The optional graph is a previously constructed Graph.
The optional debug level controls the amount of debug output (see msg(), msgin() and msgout()).
Note
the altgraph library does not generate output, the debug attribute and message methods are present for use by subclasses.
Adds a node to the graph.
Note
re-adding a node that was previously removed using removeNode() will reinstate the previously removed node.
Creates a new node using cls(*args, **kwds) and adds that node using addNode().
Returns the newly created node.
Removes a node from the graph when it exists. The node argument is either a node object, or the graphident of a node.
Creates a reference from fromnode to tonode. The optional edge_data is associated with the edge.
Fromnode and tonode can either be node objects or the graphident values for nodes.
Removes the reference from fromnode to tonode if it exists.
Returns the graphident attribute of node, or the graph itself when node is None.
Same as getRawIdent(), but only if the node is part of the graph.
Node can either be an actual node object or the graphident of a node.
Returns a given node in the graph, or Node when it cannot be found.
Node is either an object with a graphident attribute or the graphident attribute itself.
Returns True if node is a member of the graph. Node is either an object with a graphident attribute or the graphident attribute itself.
Yield all nodes that are entirely reachable by condition starting fromt he given start node or the graph root.
Note
objects are only reachable from the graph root when there is a reference from the root to the node (either directly or through another node)
Yield all nodes in the graph.
Returns two iterators that yield the nodes reaching by outgoing and incoming edges.
Filter the ObjectGraph in-place by removing all edges to nodes that do not match every filter in the given filter list
Returns a tuple containing the number of: (nodes_visited, nodes_removed, nodes_orphaned)
The current debug level.
Print a debug message at the current indentation level when the current debug level is level or less.
Print a debug message when the current debug level is level or less, and increase the indentation level.
Decrease the indentation level and print a debug message when the current debug level is level or less.