Closed GoogleCodeExporter closed 9 years ago
I've reproduced this error in the to_string() method of Edge. The problem is
with the following line:
edge_attr.append( attr + '=' + quote_if_necessary(value) )
This problem can be elegantly fixed by making quote_if_necessary(x) return
1) if x is a string, a quoted version of the
2) if x is a number, str(x)
3) if x is anything else, "%s" % str(x)
This will both address the problem as well as allow light serialization of
lists, dictionaries, and such into
GraphViz fields.
Original comment by dru...@gmail.com
on 13 Dec 2009 at 7:59
There is even simpler solution for that. The str function would be called
automatically on everything not being a string if instead of:
edge_attr.append( attr + '=' + quote_if_necessary(value) )
you do just:
edge_attr.append("%s=%s" % (attr, quote_if_necessary(value)))
Original comment by dupakrop...@googlemail.com
on 14 May 2010 at 11:50
Original comment by ero.carr...@gmail.com
on 30 Oct 2010 at 5:33
Original issue reported on code.google.com by
gerwinde...@gmail.com
on 8 Apr 2008 at 11:09