summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmile Anclin <emile.anclin@logilab.fr>2008-09-09 18:52:27 +0200
committerEmile Anclin <emile.anclin@logilab.fr>2008-09-09 18:52:27 +0200
commitb65a2fe2612b7c180aadcb1d1eabd8f5375a0807 (patch)
tree3eb7258ef7c71de677b7047c2b40231120ed5bd1
parenta46eaf83ce840171507100261fa63e95f71d5469 (diff)
downloadlogilab-common-b65a2fe2612b7c180aadcb1d1eabd8f5375a0807.tar.gz
fix emit_edge bug #5945
-rw-r--r--graph.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/graph.py b/graph.py
index 30e1715..624fa27 100644
--- a/graph.py
+++ b/graph.py
@@ -54,7 +54,7 @@ class DotBackend:
def get_source(self):
"""returns self._source"""
if self._source is None:
- self.emit("}")
+ self.emit("}\n")
self._source = '\n'.join(self.lines)
del self.lines
return self._source
@@ -104,8 +104,8 @@ class DotBackend:
Authorized props: see http://www.graphviz.org/doc/info/attrs.html
"""
attrs = ['%s="%s"' % (prop, value) for prop, value in props.items()]
- self.emit('edge [%s];' % ", ".join(attrs))
- self.emit('%s -> %s' % (normalize_node_id(name1), normalize_node_id(name2)))
+ n_from, n_to = normalize_node_id(name1), normalize_node_id(name2)
+ self.emit('%s -> %s edge [%s];' % (n_from, n_to, ", ".join(attrs)) )
def emit_node(self, name, **props):
"""Authorized props: see http://www.graphviz.org/doc/info/attrs.html