diff options
author | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2010-04-20 07:46:13 +0200 |
---|---|---|
committer | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2010-04-20 07:46:13 +0200 |
commit | 5934d1f7eb452e9cea2e5ee3a5701426fab26ca9 (patch) | |
tree | 9c396c2fccb0554145ce2561436ae0eb8115359a | |
parent | e7758ecb6d77cd7e990c45b60c414442b7d72241 (diff) | |
download | logilab-common-5934d1f7eb452e9cea2e5ee3a5701426fab26ca9.tar.gz |
add docstring
-rw-r--r-- | graph.py | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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) |