Package logilab :: Package common :: Module graph
[frames] | no frames]

Module graph

source code

Graph manipulation utilities.

(dot generation adapted from pypy/translator/tool/make_dot.py)

:copyright: 2000-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
:license: General Public License version 2 - http://www.gnu.org/licenses

Classes
  DotBackend
Dot File backend.
  GraphGenerator
Functions
 
escape(value)
Make <value> usable in a dot file.
source code
 
get_cycles(graph_dict, vertices=None)
given a dictionary representing an ordered graph (i.e.
source code
 
has_path(graph_dict, fromnode, tonode, path=None)
generic function taking a simple graph definition as a dictionary, with node has key associated to a list of nodes directly reachable from it.
source code
 
normalize_node_id(nid)
Returns a suitable DOT node id for `nid`.
source code
 
target_info_from_filename(filename)
Transforms /some/path/foo.png into ('/some/path', 'foo.png', 'png').
source code
Variables
  __package__ = 'logilab.common'
Function Details

get_cycles(graph_dict, vertices=None)

source code 
given a dictionary representing an ordered graph (i.e. key are vertices
and values is a list of destination vertices representing edges), return a
list of detected cycles

has_path(graph_dict, fromnode, tonode, path=None)

source code 
generic function taking a simple graph definition as a dictionary, with
node has key associated to a list of nodes directly reachable from it.

Return None if no path exists to go from `fromnode` to `tonode`, else the
first path found (as a list including the destination node at last)