Dot.py should support pretty printed dot files
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dotdepends |
New
|
Undecided
|
Unassigned |
Bug Description
A current assumption of the Dot.py module (which provides an API for a dot file) is that the dot file is not pretty printed.
Dot.py should work with pretty printed dot files.
One can pretty print a dot file with 'nop afile.dot'.
Pretty printed dot files often split single nodes and edges (aka 'joins;) onto multiple lines. However, Dot.py assumes all node information is on one line and all join info is on one line, thus failing for pretty printed dot files.
This may be easy to fix.
Current Dot.py reads the dot file with: self.dot = f.readlines()
Then self.dot is spit into sections in Dot.py's __init__() (into header, nodes, joins, and footer).
An approach that would support pretty printed dot files may be to use f.read() and then split(';') the file on ";" since that is the delimiter for dot 'lines'. Would need to make all appropriate adjustements in __init__ method calls to ensure proper results.