From 2b6af2c5e95497ba9f7ea23eb9aef9f3bfc22aa2 Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Thu, 7 Sep 2006 06:36:54 +0000 Subject: Add c_intp to ctypeslib. Add converttree to alter_code functions. Fix ctypeslib when ctypes is not available. --- numpy/oldnumeric/alter_code1.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'numpy/oldnumeric/alter_code1.py') 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 isinstance(..., ) """ -__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) -- cgit v1.2.1