Current File : //usr/lib64/python2.7/site-packages/numpy/numarray/alter_code2.pyo
�
E�`Qc@s�dZgZddlZejd�ddlZddlZddlZd�Zd�Zd�Z	d�Z
ejjd�Z
d	�Zejjd
�Zedkr�e
ej�ndS(s`
This module converts code written for numpy.numarray to work
with numpy

FIXME:  finish this.

i����Ns.numpy.numarray.alter_code2 is not working yet.cCs*t|d�}|j|�|j�dS(Ntw(tfiletwritetclose(tnametfilestrtfid((s@/usr/lib64/python2.7/site-packages/numpy/numarray/alter_code2.pytmakenewfiles
cCsOt|�}|j�}|j�tjj|�\}}t|d|�|S(Ns.orig(RtreadRtostpathtsplitextR(RRRtbasetext((s@/usr/lib64/python2.7/site-packages/numpy/numarray/alter_code2.pyt
getandcopys
cCs)t|�}t|�}t||�dS(s�Convert the filename given from using Numeric to using NumPy

    Copies the file to filename.orig and then over-writes the file
    with the updated code
    N(RtfromstrR(tfilenameR((s@/usr/lib64/python2.7/site-packages/numpy/numarray/alter_code2.pytconvertfilescCs|d}t|�dS(Ni(R(targsR((s@/usr/lib64/python2.7/site-packages/numpy/numarray/alter_code2.pytfromargs)s
cCs=tjtjj|d��}x|D]}t|�q%WdS(s�Convert all .py files to use NumPy (from Numeric) in the directory given

    For each file, a backup of <usesnumeric>.py is made as
    <usesnumeric>.py.orig.  A new file named <usesnumeric>.py
    is then written with the updated code.
    s*.pyN(tglobR	R
tjoinR(tdirectfilestafile((s@/usr/lib64/python2.7/site-packages/numpy/numarray/alter_code2.pyt
convertall-s
cCst|�dS(N(R(targtdirnametfnames((s@/usr/lib64/python2.7/site-packages/numpy/numarray/alter_code2.pyt_func8scCstjj|td�dS(s-Convert all .py files in the tree given

    N(R	R
twalkRtNone(R((s@/usr/lib64/python2.7/site-packages/numpy/numarray/alter_code2.pytconverttree;st__main__(t__doc__t__all__twarningstwarntsysR	RRRRRR
tcurdirRRR t__name__targv(((s@/usr/lib64/python2.7/site-packages/numpy/numarray/alter_code2.pyt<module>s