Ñò
,ÏÐKc           @   s¼   d  Z  g  Z d d k Z e i d ƒ d d k Z d d k Z d d k Z d „  Z d „  Z d „  Z	 d „  Z
 e i i d „ Z d	 „  Z e i i d
 „ Z e d j o e
 e i ƒ n d S(   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.c         C   s*   t  |  d ƒ } | i | ƒ | i ƒ  d  S(   Nt   w(   t   filet   writet   close(   t   namet   filestrt   fid(    (    sJ   P:\graphics\Tools\Python26\Lib\site-packages\numpy\numarray\alter_code2.pyt   makenewfile   s    c         C   sO   t  |  ƒ } | i ƒ  } | i ƒ  t i i |  ƒ \ } } t | d | ƒ | S(   Ns   .orig(   R   t   readR   t   ost   patht   splitextR   (   R   R   R   t   baset   ext(    (    sJ   P:\graphics\Tools\Python26\Lib\site-packages\numpy\numarray\alter_code2.pyt
   getandcopy   s    
c         C   s)   t  |  ƒ } t | ƒ } t |  | ƒ d S(   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(   R   t   fromstrR   (   t   filenameR   (    (    sJ   P:\graphics\Tools\Python26\Lib\site-packages\numpy\numarray\alter_code2.pyt   convertfile   s    c         C   s   |  d } t  | ƒ d  S(   Ni   (   R   (   t   argsR   (    (    sJ   P:\graphics\Tools\Python26\Lib\site-packages\numpy\numarray\alter_code2.pyt   fromargs)   s    
c         C   s=   t  i  t i i |  d ƒ ƒ } x | D] } t | ƒ q% Wd S(   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(   t   globR	   R
   t   joinR   (   t   direct   filest   afile(    (    sJ   P:\graphics\Tools\Python26\Lib\site-packages\numpy\numarray\alter_code2.pyt
   convertall-   s     c         C   s   t  | ƒ d  S(   N(   R   (   t   argt   dirnamet   fnames(    (    sJ   P:\graphics\Tools\Python26\Lib\site-packages\numpy\numarray\alter_code2.pyt   _func8   s    c         C   s   t  i i |  t d ƒ d S(   s-   Convert all .py files in the tree given

    N(   R	   R
   t   walkR   t   None(   R   (    (    sJ   P:\graphics\Tools\Python26\Lib\site-packages\numpy\numarray\alter_code2.pyt   converttree;   s    t   __main__(   t   __doc__t   __all__t   warningst   warnt   sysR	   R   R   R   R   R   R
   t   curdirR   R   R    t   __name__t   argv(    (    (    sJ   P:\graphics\Tools\Python26\Lib\site-packages\numpy\numarray\alter_code2.pyt   <module>   s   			
		