summaryrefslogtreecommitdiff
path: root/graph.py
diff options
context:
space:
mode:
authorSylvain Th?nault <sylvain.thenault@logilab.fr>2010-04-20 07:46:13 +0200
committerSylvain Th?nault <sylvain.thenault@logilab.fr>2010-04-20 07:46:13 +0200
commit5934d1f7eb452e9cea2e5ee3a5701426fab26ca9 (patch)
tree9c396c2fccb0554145ce2561436ae0eb8115359a /graph.py
parente7758ecb6d77cd7e990c45b60c414442b7d72241 (diff)
downloadlogilab-common-5934d1f7eb452e9cea2e5ee3a5701426fab26ca9.tar.gz
add docstring
Diffstat (limited to 'graph.py')
-rw-r--r--graph.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/graph.py b/graph.py
index d4f55cd..4d28df8 100644
--- a/graph.py
+++ b/graph.py
@@ -157,6 +157,13 @@ class UnorderableGraph(Exception):
return 'cycles in graph: %s' % self.cycles
def ordered_nodes(graph):
+ """takes a dependency graph dict as arguments and return an ordered tuple of
+ nodes starting with nodes without dependencies and up to the outermost node.
+
+ If there is some cycle in the graph, :exc:`UnorderableGraph` will be raised.
+
+ Also the given graph dict will be emptied.
+ """
cycles = get_cycles(graph)
if cycles:
cycles = '\n'.join(' -> '.join(cycle) for cycle in cycles)