pombreda / pydot

Automatically exported from code.google.com/p/pydot
MIT License
0 stars 0 forks source link

Multiple styles not correctly rendered ("style=S1, S2=true") #85

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. add a node constructed like pydot.Node('A', shape='box', 
style='rounded,dotted')
2. use graph.write_raw() to emit the dot equivalent

What is the expected output? What do you see instead?
expected output:
  A [style="rounded,dotted", shape=box];

actual output:
  A [style=rounded,dotted, shape=box];

Note the lack of quoting. dot sees only "rounded" and ignores "dotted".

What version of the product are you using? On what operating system?
svn r29 from http://pydot.googlecode.com/svn/trunk

Please provide any additional information below.

Here is my complete test script:
"""
import pydot

graph = pydot.Dot(graph_type='digraph')
graph.add_node(pydot.Node('A', shape='box', style='rounded,dotted'))

graph.write_raw('twostyles.dot')
"""

and here is the complete dot file that I *expect* from that script:

"""
digraph G {
A [style="rounded,dotted", shape=box];
}
"""

Original issue reported on code.google.com by gerg.w...@gmail.com on 20 Sep 2013 at 6:02

GoogleCodeExporter commented 9 years ago
Oops, issue title is slightly misleading. I'm pretty sure this is a quoting 
bug. I got confused because using write_dot() creates output like 

  A [style=rounded, dotted=true, shape=box, ...];

I assume that's because dot interprets ",dotted" as an attribute with no value, 
so gives it the default value true. Issue title should be

  Multiple styles not correctly rendered (quotes missing)

Original comment by gerg.w...@gmail.com on 20 Sep 2013 at 6:04