summaryrefslogtreecommitdiff
path: root/graph.py
diff options
context:
space:
mode:
Diffstat (limited to 'graph.py')
-rw-r--r--graph.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/graph.py b/graph.py
index 94a71b6..d62e8c0 100644
--- a/graph.py
+++ b/graph.py
@@ -134,14 +134,14 @@ 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 [%s];' % (n_from, n_to, ", ".join(attrs)) )
+ self.emit('%s -> %s [%s];' % (n_from, n_to, ', '.join(sorted(attrs))) )
def emit_node(self, name, **props):
"""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)))
+ self.emit('%s [%s];' % (normalize_node_id(name), ', '.join(sorted(attrs))))
def normalize_node_id(nid):
"""Returns a suitable DOT node id for `nid`."""