Current File : //proc/self/root/proc/self/root/lib64/python2.7/site-packages/numpy/oldnumeric/alter_code2.pyc |
�
E�`Qc @ s� d Z g Z d d l Z e j d � d d l Z d d l Z d d l Z d d l Z d � Z d � Z d � Z
d � Z d d l Z d � Z
d � Z d
� Z d � Z d � Z e j j d
� Z d � Z e j j d � Z e d k r� e e j � n d S( s�
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
* Changes import statements
* Change typecode= to dtype=
* Eliminates savespace=xxx keyword arguments
* Removes it when keyword is not given as well
* replaces matrixmultiply with dot
* converts functions that don't give axis= keyword that have changed
* converts functions that don't give typecode= keyword that have changed
* converts use of capitalized type-names
* converts old function names in oldnumeric.linear_algebra,
oldnumeric.random_array, and oldnumeric.fft
i����Ns0 numpy.oldnumeric.alter_code2 is not working yet.c C s^ | j d d � } | j d d � } | j d d � } | j d d � } | j d d � } | S(
Ns 's's 'h's 'b's 'B's '1's 'w's 'H's 'u's 'I'( t replace( t astr( ( sB /usr/lib64/python2.7/site-packages/numpy/oldnumeric/alter_code2.pyt replacetypechars# s c C s� d | } d | } d | } d } | j | d | � } | j | d | | f � } d } t | � } t d | � } xn | j | | � }
|
d k r� Pn |
| } | | d k r� q{ n d | |
| | | f } | | | 7} q{ | | f S( Ns import %ss
import %s as s from %s import i s import %s as %st *s %sfrom %s import %s( R t lent find( t fstrt namet newnamet importstrt importasstrt fromstrt fromallt indt Nlent Nlen2t found( ( sB /usr/lib64/python2.7/site-packages/numpy/oldnumeric/alter_code2.pyt
changeimports+ s&