diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-09-07 06:36:54 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-09-07 06:36:54 +0000 |
commit | 2b6af2c5e95497ba9f7ea23eb9aef9f3bfc22aa2 (patch) | |
tree | 2217d8ce5bae1b2f044528c8932e5176aeb8ee93 /numpy/oldnumeric/alter_code2.py | |
parent | c4b98bdd9b0046494c1f972912137b4a7e5c6874 (diff) | |
download | numpy-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_code2.py')
-rw-r--r-- | numpy/oldnumeric/alter_code2.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/numpy/oldnumeric/alter_code2.py b/numpy/oldnumeric/alter_code2.py index c8ecd114c..6db8fe3e2 100644 --- a/numpy/oldnumeric/alter_code2.py +++ b/numpy/oldnumeric/alter_code2.py @@ -2,6 +2,8 @@ This module converts code written for numpy.oldnumeric to work with numpy +FIXME: Flesh this out. + Makes the following changes: * Converts typecharacters '1swu' to 'bhHI' respectively when used as typecodes @@ -17,11 +19,11 @@ Makes the following changes: oldnumeric.random_array, and oldnumeric.fft """ -#__all__ = ['convertfile', 'convertall'] +#__all__ = ['convertfile', 'convertall', 'converttree'] __all__ = [] import warnings -warnings.warn("numpy.oldnumeric.alter_code2 is not ready yet.") +warnings.warn("numpy.oldnumeric.alter_code2 is not working yet.") import sys import os @@ -131,5 +133,14 @@ 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) |