Skip to content

Commit

Permalink
Fixes #1. Don't use -> For tuples that are values of dictionary key-v…
Browse files Browse the repository at this point in the history
…alue pairs. bump version.
  • Loading branch information
parrt committed Aug 28, 2017
1 parent a6fc29b commit 01ae844
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lolviz.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def dictviz(d):
"""
labels = []
for key,value in d.items():
labels.append("%s→%s" % (repr(key),elviz(value,True)))
labels.append("%s→%s" % (repr(key),elviz(value,False)))
s += ' mainlist [color="#444443", fontsize="9", fontcolor="#444443", fontname="Helvetica", style=filled, fillcolor="#FBFEB0", label = "'+'|'.join(labels)+'"];\n'
s += '}\n'
return graphviz.Source(s)
Expand Down Expand Up @@ -157,7 +157,7 @@ def elviz(el, showassoc):
if el is None:
els = ' '
elif showassoc and type(el) == tuple and len(el) == 2:
els = "%s→%s" % (elviz(el[0], showassoc), elviz(el[1], showassoc))
els = "%s→%s" % (elviz(el[0], showassoc), elviz(el[1], False))
elif type(el)==set:
els = '{'+', '.join([elviz(e, showassoc) for e in el])+'}'
elif type(el) == dict:
Expand Down Expand Up @@ -226,4 +226,5 @@ def __init__(self, value, next=None):
g = llistviz(head, valuefield='value', nextfield='next')
# or
g = llistviz(head, value=lambda p:p.value, next=lambda p:p.next)
g = listviz([(3,(1, 2))])
g.render(view=True)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='lolviz',
version='1.1',
version='1.1.1',
url='https://github.com/parrt/lolviz',
license='BSD',
py_modules=['lolviz'],
Expand Down

0 comments on commit 01ae844

Please sign in to comment.