summaryrefslogtreecommitdiff
path: root/graph.py
diff options
context:
space:
mode:
Diffstat (limited to 'graph.py')
-rw-r--r--graph.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/graph.py b/graph.py
index e4f3c65..097f503 100644
--- a/graph.py
+++ b/graph.py
@@ -99,15 +99,17 @@ class DotBackend:
self.lines.append(line)
def emit_edge(self, name1, name2, **props):
- """emit an edge from <name1> to <name2>."""
- #edge properties: see http://www.graphviz.org/doc/info/attrs.html
+ """emit an edge from <name1> to <name2>.
+ edge properties: see http://www.graphviz.org/doc/info/attrs.html
+ """
attrs = ['%s="%s"' % (prop, value) for prop, value in props.items()]
n_from, n_to = normalize_node_id(name1), normalize_node_id(name2)
self.emit('%s -> %s [%s];' % (n_from, n_to, ", ".join(attrs)) )
def emit_node(self, name, **props):
- """emit a node with given properties"""
- # node properties: see http://www.graphviz.org/doc/info/attrs.html
+ """emit a node with given properties.
+ node properties: see http://www.graphviz.org/doc/info/attrs.html
+ """
attrs = ['%s="%s"' % (prop, value) for prop, value in props.items()]
self.emit('%s [%s];' % (normalize_node_id(name), ", ".join(attrs)))