diff options
Diffstat (limited to 'graph.py')
-rw-r--r-- | graph.py | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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))) |