#!/usr/bin/python
#
-# Copyright (C) 2010-2011 W. Trevor King <wking@drexel.edu>
+# Copyright (C) 2010-2012 W. Trevor King <wking@drexel.edu>
#
# This file is part of Hooke.
#
Serialize the tree with depth marking branches.
>>> for depth,node in a.thread():
- ... print "%*s" % (2*depth+1, node.n)
+ ... print('{}{}'.format(' '*2*depth, node.n))
a
b
d
branch splits.
>>> for depth,node in a.thread(flatten=True):
- ... print "%*s" % (2*depth+1, node.n)
+ ... print('{}{}'.format(' '*2*depth, node.n))
a
b
d
if __name__ == '__main__':
pt = python_tree(root_path='../hooke', root_modname='hooke')
for node in pt.traverse():
- print node.modname
+ print(node.modname)
make_module_txt(node.modname, [c.modname for c in node])