summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>2008-11-13 10:30:50 +0100
committerAdrien Di Mascio <Adrien.DiMascio@logilab.fr>2008-11-13 10:30:50 +0100
commitf3fa43de6a1f1e169abaec895c054c4602d90afb (patch)
treea99a2b10c82053e3f0b93d376429243eb83dab29
parent5ab11c41e4a2be1fd4041fd952cbd25c4d74fbc2 (diff)
downloadlogilab-common-f3fa43de6a1f1e169abaec895c054c4602d90afb.tar.gz
fix dot files' edge generation
Before this patch, edges were defined using the following scheme : Node1 -> Node2 edge [attrs...] Node2 -> Node3 which `dot` understands as three instructions : Node1 -> Node2 ; edge [attr...]; Node2 -> Node3; which means that edge properties are applied to the Node2->Node3 edge rather than to the Node1->Node2 edge. The correct syntax is : Node1 -> Node2 [attr...]; Node2 -> Node3;
-rw-r--r--graph.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/graph.py b/graph.py
index a672166..c6469ef 100644
--- a/graph.py
+++ b/graph.py
@@ -105,7 +105,7 @@ class DotBackend:
"""
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 edge [%s];' % (n_from, n_to, ", ".join(attrs)) )
+ self.emit('%s -> %s [%s];' % (n_from, n_to, ", ".join(attrs)) )
def emit_node(self, name, **props):
"""Authorized props: see http://www.graphviz.org/doc/info/attrs.html