Closed GoogleCodeExporter closed 9 years ago
Make sure the URL is in quotes in the dot file, e.g.
node = pydot.Node(nodeid, label=name, shape="rect", style="filled",
fillcolor="green", URL=('"http://%s:40000/job?guid=%s"' % (self.grid,
self.resultcache[name])))
Note the extra quotes
Original comment by kevin.ma...@gmail.com
on 31 Mar 2009 at 10:49
This is really an unsatisfactory solution. If the variable 'name' above
contained a
colon, the name would be truncated at that character:
>>> myname = "kept:lost"
>>> n = pydot.Node(myname)
>>> n.get_name()
'kept'
I shouldn't need to perform a deep inspection of my strings to weed out colons.
That
is, I shouldn't have to perform a colonoscopy.
Do we have any alternatives? Is there any way to change the separator character?
Original comment by oli...@gmail.com
on 6 May 2009 at 11:03
[deleted comment]
I've been able to add strings with colons, wrapping the string with quotes,
like
this:
myString = "\"" + "http://www.google.com" + "\""
n = pydot.Node(myString)
you have to put the quotes before you create the node, otherwise it doesn't
work.
It's kinda weird, but it works.
Original comment by vpa...@gmail.com
on 25 Nov 2009 at 4:39
Putting aside URLs for a moment, imagine that you have a huge collection of
assorted
strings that will be used as Node labels. If any one of them _might_ contain a
colon,
you need to wrap _all_ of my labels in escaped quotes. Not only does this
increase
the length of every label by two characters (which can matter with large
graphs), but
you need to add and strip those quotes whenever you move from pydot back to the
original domain of strings.
I appreciate that there is a workaround, but that workaround is (1)
undocumented, (2)
adds overhead to every node creation and label use, and (3) increases the
length of
the labels. This is a bug that deserves a proper solution.
Original comment by oli...@gmail.com
on 25 Nov 2009 at 5:56
hello
I thing this problem is somehow related :
n1 = '"%s (= %s)"' % ("aaa-vvv", "1:2.1-3")
n2 = '"%s (= %s)"' % ("aaa-vvv", "1:2.1-3")
In [25]: pydot.Edge(pydot.Node(n1),pydot.Node(n2)).to_string()
Out[25]: '""aaa-vvv (= 1":"2.1-3)"" -- ""aaa-vvv (= 1":"2.1-3)"";'
while it should be :
"aaa-vvv (= 1:2.1-3)" -> "aaa-vvv (= 1:2.1-3)"
the node itself is ok :
In [26]: pydot.Node(n1).to_string()
Out[26]: '"aaa-vvv (= 1:2.1-3)";'
is there a workaround for this ?
Original comment by dr.mu...@gmail.com
on 13 Oct 2010 at 1:29
me again.
I think this specific issue can be resolved with simple patch in parse_node_ref
:
844c844
< if node_str.startswith('"') and node_str.endswith('"'):
---
> if node_str.startswith('"') and node_str.endswith('"') and
node_str.count('"') % 2 != 0:
does this break anything else ?
Original comment by dr.mu...@gmail.com
on 13 Oct 2010 at 2:29
Responding to the original issue: The problem with the colon in Node names is
that GraphViz will use them to specify a port where to attach edges, it's a
Graphviz artifact. The way pydot supports them is to allow them in names, if
you wish to simply have colon characters in the name simply add quotes to the
string.
Original comment by ero.carr...@gmail.com
on 30 Oct 2010 at 11:26
Issue 38 has been merged into this issue.
Original comment by ero.carr...@gmail.com
on 30 Oct 2010 at 11:29
Original issue reported on code.google.com by
divya...@gmail.com
on 24 Mar 2009 at 2:32