Skip to content
Permalink
Browse files

Rewrites Graph#__str__()

  • Loading branch information...
remram44 committed Mar 24, 2014
1 parent 7f723cc commit 56123d2c755ec83bf29d4736052d698cf48c1e96
Showing with 8 additions and 7 deletions.
  1. +8 −7 vistrails/core/data_structures/graph.py
@@ -678,14 +678,15 @@ def __str__(self):
"""
vs = self.vertices.keys()
vs.sort()
al = []
for i in [map(lambda (t, i): (f, t, i), l)
for (f, l) in self.adjacency_list.items()]:
al.extend(i)
al = [(vfrom, vto, edgeid)
for vfrom, lto in self.adjacency_list.iteritems()
for vto, edgeid in lto]
al.sort()
return "digraph G { " \
+ ";".join([str(s) for s in vs]) + ";" \
+ ";".join(["%s -> %s [label=\"%s\"]" % s for s in al]) + "}"
return ("digraph G {\n"
+ ";".join([str(s) for s in vs])
+ ";\n"
+ "\n".join(["%s -> %s [label=\"%s\"];" % s for s in al])
+ "\n}")

def __repr__(self):
""" __repr__() -> str

0 comments on commit 56123d2

Please sign in to comment.
You can’t perform that action at this time.