pydot / pydot-ng

Python interface to Graphviz's Dot language compatible with Python 2 nad Python 3
MIT License
23 stars 10 forks source link

[68] Invalid command line generated when extra parameters specified #9

Open prmtl opened 9 years ago

prmtl commented 9 years ago

Reported by xrogerma...@gmail.com, 2012-03-08T19:21:04Z

What steps will reproduce the problem?
  1. Generate any graph structure
  2. Call the write function with a list as the parameter, using more than one value in the list. For example : graph.write_svg(somefile, prog=['twopi', 'overlap=scale'])

Expected : The graph is generated using the extra settings specified Actual : The library raises an error saying that the command line was invalid (with the example above : "InvocationException: Program terminated with status: 2. stderr follows: Error: twopi: can't open overlap=scale")

Pydot-1.0.28-py2.7, on windows 7 x64

I think the bogus line is line 1985 : cmdline = [self.progs[prog], '-T'+format, tmp_name] + args

The error is that the args list is appended at the end of the command list, while they should be placed between the -T and input elements (the rule being that the input files must be placed at the end of the command) Originally assigned to ero.carr...@gmail.com From: https://code.google.com/p/pydot/issues/detail?id=68

prmtl commented 9 years ago

Comment by himanshu...@gmail.com, 2012-03-27T03:53:30Z

Also the write_ function does not honour the program set using set_prog.

prmtl commented 9 years ago

Comment by ero.carr...@gmail.com, 2012-06-26T15:02:11Z

The correct form of attributes passed through the command line is, according to the manual pages:

-(G|N|E)name=value

Hence, the following line works:

graph.write_svg(somefile, prog=['twopi', '-Goverlap=scale'])

The issue in the comment is valid and will be fixed. Assigned to ero.carr...@gmail.com