%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/self/root/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/
Upload File :
Create Path :
Current File : //proc/self/root/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/from_template.pyc

�
�9Zc@`s�dZddlmZmZmZddgZddlZddlZddlZej	dej
�Zej	dej
�Zej	dej
�Z
d	�Zej	d
�Zej	d�Zej	d�Zd
�Zej	d�Zd�Zd�Zej	d�Zd�Zd�Zej	dej
�Zd�Zd�Zed�Zedkr�yejdZWn#e k
r�ej!Z"ej#Z$n=Xe%ed�Z"ej&j'e�\Z(Z)e(Z*e%e*d�Z$e"j+�Z,ee,�Z-e$j.e-�ndS(s�

process_file(filename)

  takes templated file .xxx.src and produces .xxx file where .xxx
  is .pyf .f90 or .f using the following template rules:

  '<..>' denotes a template.

  All function and subroutine blocks in a source file with names that
  contain '<..>' will be replicated according to the rules in '<..>'.

  The number of comma-separeted words in '<..>' will determine the number of
  replicates.

  '<..>' may have two different forms, named and short. For example,

  named:
   <p=d,s,z,c> where anywhere inside a block '<p>' will be replaced with
   'd', 's', 'z', and 'c' for each replicate of the block.

   <_c>  is already defined: <_c=s,d,c,z>
   <_t>  is already defined: <_t=real,double precision,complex,double complex>

  short:
   <s,d,c,z>, a short form of the named, useful when no <p> appears inside
   a block.

  In general, '<..>' contains a comma separated list of arbitrary
  expressions. If these expression must contain a comma|leftarrow|rightarrow,
  then prepend the comma|leftarrow|rightarrow with a backslash.

  If an expression matches '\<index>' then it will be replaced
  by <index>-th expression.

  Note that all '<..>' forms in a block must have the same number of
  comma-separated entries.

 Predefined named template rules:
  <prefix=s,d,c,z>
  <ftype=real,double precision,complex,double complex>
  <ftypereal=real,double precision,\0,\1>
  <ctype=float,double,complex_float,complex_double>
  <ctypereal=float,double,\0,\1>

i(tdivisiontabsolute_importtprint_functiontprocess_strtprocess_fileNs2(\n|\A)((     (\$|\*))|)\s*(subroutine|function)\bs+\n\s*end\s*(subroutine|function)\b.*(\n|\Z)s\n     (\$|\*)\s*function\bcC`sg}d}xtrtj||�}|dkr7Pn|j�}tj|||j��r�xStr�|jd||�}|dkr�Pn|}|||d!dkraPqaqaWn|d7}t	j||j��}|r�|j�dp�t
|�}}|j||f�qW|S(s� Return a list of tuples for each function or subroutine each
    tuple is the start and end of a subroutine or function to be
    expanded.
    is
i����is
     $iN(tTruetroutine_start_retsearchtNonetstarttfunction_start_retmatchtendtrfindtroutine_end_retlentappend(tastrtspanlisttindtmR	tiR((sP/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/from_template.pytparse_structure;s(		
&s<\s*(\w[\w\d]*)\s*>s<\s*(\w[\w\d]*)\s*=\s*(.*?)\s*>s<\s*((.*?))\s*>cC`srtj|�}i}xV|D]N}|dj�p;t|�}|djdd�}t|�}|||<qW|S(Niis\,s@comma@(tnamed_retfindalltstript
unique_keytreplacetconv(Rtrepstnamestreptnametrepltthelist((sP/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/from_template.pytfind_repl_patternsZs
s\A\\(?P<index>\d+)\ZcC`s�|jd�}g|D]}|j�^q}xYtt|��D]E}tj||�}|rAt|jd��}||||<qAqAWdj|�S(Nt,tindex(	tsplitRtrangeRtitem_reRtinttgrouptjoin(RtbtxtlRRtj((sP/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/from_template.pyRescC`sXt|j��}t}d}x3|sSd|}||krJ|d7}q!t}q!W|S(s( Obtain a unique key given a dictionary.is__l%s(tlisttkeystFalseR(tadicttallkeystdonetntnewkey((sP/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/from_template.pyRos	


s\A\s*(\w[\w\d]*)\s*\Zc`s|jdd�}|jdd�}t|��tjd|�}�fd�}tj||�}d}d}i�x+tj|�D]}|�kr��j||j|d��}|dkr�t	d|��n||kr�|j
d�r�|||<ng|jd	�D]}|jd
d	�^q
}t|�}	|dkr\|	}|�|<|}q�|	|kru|�|<q�t
d|d	j�|�||f�q�q�W�s�|S��fd�}
d
}x.t|�D] �|tj|
|�d7}q�W|jdd�}|jdd�}|S(Ns\>s@rightarrow@s\<s@leftarrow@s<\1>c`s�t|jd�jdd��}tj|�r8d|Sd}x-�j�D]}�||krK|}qKqKW|dkr�t��}|�|<nd|S(Nis\,s@comma@s<%s>(RR*Rttemplate_name_reRRR1R(tmobjR"R tkey(tlnames(sP/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/from_template.pytlistrepl�s!

sNo replicates found for <%s>t_R$s@comma@sHMismatch in number of replacements (base <%s=%s>) for <%s=%s>. Ignoring.c`s.|jd�}�j|�d|g��S(Ni(R*tget(R9R (tktrules(sP/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/from_template.pytnamerepl�sts

t>t<(RR#Rtsubtlist_reRttemplate_reRR>t
ValueErrort
startswithR&RtprintR+R'(tsubstrRR<tnumsubst	base_ruletrR"RtruletnumRAtnewstr((R?R;R@sP/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/from_template.pyt
expand_sub~sF

.
	
(cC`s�|}d}t|�}d}i}|jt�xm|D]e}||||d!7}|jt|||d!��|t||d|d!|�7}|d}q8W|||7}|S(NRBii(Rtupdatet_special_namesR#RR(tallstrRQtwritestrtstructtoldendRRE((sP/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/from_template.pyR�s

"s9(\n|\A)\s*include\s*['\"](?P<name>[\w\d./\\]+[.]src)['\"]cC`s�tjj|�}t|�}g}x�|D]�}tj|�}|r�|jd�}tjj|�stjj||�}ntjj	|�r�t
d|�|jt|��q�|j
|�q+|j
|�q+W|j�|S(NR sIncluding file(tostpathtdirnametopentinclude_src_reRR*tisabsR+tisfileRJtextendtresolve_includesRtclose(tsourcetdtfidtlinestlineRtfn((sP/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/from_template.pyRa�s 


cC`st|�}tdj|��S(NRB(RaRR+(RcRf((sP/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/from_template.pyR�ss�
<_c=s,d,c,z>
<_t=real,double precision,complex,double complex>
<prefix=s,d,c,z>
<ftype=real,double precision,complex,double complex>
<ctype=float,double,complex_float,complex_double>
<ftypereal=real,double precision,\0,\1>
<ctypereal=float,double,\0,\1>
t__main__iRNtw(/t__doc__t
__future__RRRt__all__RYtsystretcompiletIRRR
RRGRRFR#R(RRR8RRRR]RaRRTt__name__targvtfilet
IndexErrortstdinRetstdouttoutfileR\RZtsplitexttbasetexttnewnametreadRURVtwrite(((sP/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/from_template.pyt<module>.sJ		
	
		<				
	


Zerion Mini Shell 1.0