summaryrefslogtreecommitdiff
path: root/numpy/oldnumeric/alter_code1.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-09-07 06:36:54 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-09-07 06:36:54 +0000
commit2b6af2c5e95497ba9f7ea23eb9aef9f3bfc22aa2 (patch)
tree2217d8ce5bae1b2f044528c8932e5176aeb8ee93 /numpy/oldnumeric/alter_code1.py
parentc4b98bdd9b0046494c1f972912137b4a7e5c6874 (diff)
downloadnumpy-2b6af2c5e95497ba9f7ea23eb9aef9f3bfc22aa2.tar.gz
Add c_intp to ctypeslib. Add converttree to alter_code functions. Fix ctypeslib when ctypes is not available.
Diffstat (limited to 'numpy/oldnumeric/alter_code1.py')
-rw-r--r--numpy/oldnumeric/alter_code1.py12
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)