aboutsummaryrefslogtreecommitdiff
path: root/treeprint.py
diff options
context:
space:
mode:
Diffstat (limited to 'treeprint.py')
-rw-r--r--treeprint.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/treeprint.py b/treeprint.py
index ce4f672..281b406 100644
--- a/treeprint.py
+++ b/treeprint.py
@@ -21,14 +21,19 @@ etc: this is a case of GIGO. Deal with it.
"""
def showdict(data, indent):
+ first=True
for (key, value) in data.iteritems():
+ if first:
+ first=False
+ else:
+ print
print " "*indent + "("+key,
if type(value)==dict:
print ""
- showdict(value, indent+4)
+ showdict(value, indent+4),
else:
- print " "+value+")"
-
+ print " "+value,
+ print ")",
listing={}