Commit 79ae028b authored by Bram Schoenmakers's avatar Bram Schoenmakers

Fix syntax ambiguity due to node names starting with a number

Prefix all node names with an underscore, print the proper number
through the "label" attribute.
parent 36d0bdcb
......@@ -44,15 +44,17 @@ class DotPrinter(Printer):
self.todolist.number(t), t.text()
)) for t in p_todos]))
node_name = lambda t: str(self.todolist.number(t))
node_name = lambda t: '_' + str(self.todolist.number(t))
node_label = lambda t: str(self.todolist.number(t))
node_tooltip = lambda t: escape(t.text())
result = 'digraph {\n'
# print todos
for todo in p_todos:
result += ' {} [tooltip="{}"]\n'.format(
result += ' {} [label="{}", tooltip="{}"]\n'.format(
node_name(todo),
node_label(todo),
node_tooltip(todo),
)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment