l.b.b.s.SpecGraph : class documentation

Part of lp.blueprints.browser.specification View In Hierarchy

A directed linked graph of nodes representing spec dependencies.
Method __init__ Undocumented
Method newNode Return a new node based on the given spec.
Method getNode Return the node with the given spec, or None if not matched.
Method newOrExistingNode Return the node for the spec.
Method link Form a direction link from from_node to to_node.
Method addDependencyNodes Add nodes for the specs that the given spec depends on,
Method addBlockedNodes Add nodes for specs that the given spec blocks, transitively.
Method walkSpecsMakingNodes Walk the specs, making and linking nodes.
Method getNodesSorted Return a list of all nodes, sorted by name.
Method getEdgesSorted Return a list of all edges, sorted by name.
Method listNodes Return a string of diagnostic output of nodes and edges.
Method getDOTGraphStatement Return a unicode string that is the DOT representation of this
def __init__(self, user=None):
Undocumented
def newNode(self, spec, root=False):
Return a new node based on the given spec.

If root=True, make this the root node.

There can be at most one root node set.

def getNode(self, spec):
Return the node with the given spec, or None if not matched.
def newOrExistingNode(self, spec):
Return the node for the spec.

If there is already a node for spec.name, return that node. Otherwise, create a new node for the spec, and return that.

def link(self, from_node, to_node):
Form a direction link from from_node to to_node.
def addDependencyNodes(self, spec):
Add nodes for the specs that the given spec depends on, transitively.
def addBlockedNodes(self, spec):
Add nodes for specs that the given spec blocks, transitively.
def walkSpecsMakingNodes(self, spec, get_related_specs_fn, link_nodes_fn):

Walk the specs, making and linking nodes.

Examples of functions to use:

get_related_specs_fn = lambda spec: spec.blocked_specs

def link_nodes_fn(node, related):
graph.link(node, related)
def getNodesSorted(self):
Return a list of all nodes, sorted by name.
def getEdgesSorted(self):
Return a list of all edges, sorted by name.

An edge is a tuple (from_node, to_node).

def listNodes(self):
Return a string of diagnostic output of nodes and edges.

Used for debugging and in unit tests.

def getDOTGraphStatement(self):
Return a unicode string that is the DOT representation of this graph.

graph : [ strict ] (graph | digraph) [ ID ] '{' stmt_list '}' stmt_list : [ stmt [ ';' ] [ stmt_list ] ] stmt : node_stmt | edge_stmt | attr_stmt | ID '=' ID | subgraph

API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.