diff options
Diffstat (limited to 'numpy/oldnumeric/alter_code1.py')
-rw-r--r-- | numpy/oldnumeric/alter_code1.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/numpy/oldnumeric/alter_code1.py b/numpy/oldnumeric/alter_code1.py index 2da1e8582..0a27fa15b 100644 --- a/numpy/oldnumeric/alter_code1.py +++ b/numpy/oldnumeric/alter_code1.py @@ -28,7 +28,7 @@ Makes the following changes: * Converts uses of type(...) is <type> isinstance(..., <type>) """ -__all__ = ['convertfile', 'convertall'] +__all__ = ['convertfile', 'convertall', 'converttree'] import sys import os @@ -195,5 +195,15 @@ def convertall(direc=os.path.curdir): for afile in files: convertfile(afile) +def _func(arg, dirname, fnames): + convertall(dirname) + +def converttree(direc=os.path.curdir): + """Convert all .py files in the tree given + + """ + os.path.walk(direc, _func, None) + + if __name__ == '__main__': fromargs(sys.argv) |