X-Git-Url: http://git.tremily.us/?p=hooke.git;a=blobdiff_plain;f=doc%2Fgenerate-hooke-txt.py;h=274afe470dafbd1e10373e51f551fed354844df7;hp=fb91500ab005ab0601f62542c6f7556eaa872a54;hb=HEAD;hpb=7762de28cee60f98882d72db0c2ae2c6009ac465 diff --git a/doc/generate-hooke-txt.py b/doc/generate-hooke-txt.py old mode 100644 new mode 100755 index fb91500..274afe4 --- a/doc/generate-hooke-txt.py +++ b/doc/generate-hooke-txt.py @@ -1,18 +1,18 @@ #!/usr/bin/python # -# Copyright (C) 2010 W. Trevor King +# Copyright (C) 2010-2012 W. Trevor King # # This file is part of Hooke. # -# Hooke is free software: you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation, either -# version 3 of the License, or (at your option) any later version. +# Hooke is free software: you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. # -# Hooke is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. +# Hooke is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General +# Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with Hooke. If not, see @@ -121,7 +121,7 @@ class Tree(list): 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 @@ -136,7 +136,7 @@ class Tree(list): 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 @@ -333,5 +333,5 @@ def python_tree(root_path='hooke', root_modname='hooke'): 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])