cudadog / pydot

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

Nodes not identified in graph #70

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create this dot file:

graph condiments {
    ketchup -- mayonnaise -- tartar -- lemon
    ketchup -- bbq
}

2. Create and run this python script:

import sys
import pydot

# first arg is the dot file
if len(sys.argv) < 2:
    exit()

g = pydot.graph_from_dot_file(sys.argv[1])

print g.get_node_list()

What is the expected output? What do you see instead?

The output is an empty list, I expected a list of nodes (ketchup, bbq, etc.)

What version of the product are you using? On what operating system?

pydot-1.0.28 with Python 2.7.1, OS X

Please provide any additional information below.

Original issue reported on code.google.com by olliegla...@gmail.com on 9 Apr 2012 at 6:11

GoogleCodeExporter commented 9 years ago
+1. 

If you have nodes implicitly defined, like:

a;
a -> b -> c -> d;
c;

Only the "explicitly" defined nodes (the ones given their own lines) will be 
accessible. It really shouldn't work this way.

Original comment by carnioja...@gmail.com on 19 Apr 2012 at 4:54

GoogleCodeExporter commented 9 years ago
Graphviz uses implicitly defined nodes as well. It would be useful to have a 
lib acting the same way.

Original comment by wod...@gmail.com on 7 May 2012 at 1:11