Current File : //usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyc
�
E�`Qc(@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZye
Wn!ek
r�ddlmZ
nXddlmZddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,g(Zd-efd.��YZd/�Zd0�Zd1�Zed2�Zd3�Zed4�Zd5�Zd6�Zd7ed8�Z ea!d9�Z"d7d7ed:�Z#d;�Z$e$�rHe%d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdM�	Z&eee'dN�Z(needO�Z(dP�Z)dQ�Z*dR�Z+dS�Z,dT�Z-dU�Z.dV�Z/dW�Z0dX�Z1dY�Z2ej3dZej4�j5Z6ej3d[ej4�j5Z7ej3d\ej4�j5Z8ej3d]ej4�j5Z9d^�Z:d_�Z;d`�Z<da�Z=db�Z>dc�Z?dd�Z@de�ZAdf�ZBdg�ZCdh�ZDdi�ZEdj�ZFdk�ZGdl�ZHdm�ZIdn�ZJdo�ZKdp�ZLe'dq�ZMdr�ZNds�ZOd=dt�ZPduefdv��YZQdefdw��YZRidx�ZSdy�ZTdz�ZUed{�ZVed|�ZWd}�ZXd~�ZYeeed�ZZd��Z[d��Z\d��Z]d��Z^ej_dC d�kr�d��Z`n	d��Z`dS(�i����N(tDistutilsError(tSet(t
get_exceptiont
Configurationtget_numpy_include_dirstdefault_config_dicttdict_appendt
appendpathtgenerate_config_pytget_cmdtallpathtget_mathlibstterminal_has_colorstred_textt
green_texttyellow_textt	blue_textt	cyan_textt	cyg2win32tmingw32tall_stringst
has_f_sourcesthas_cxx_sourcestfilter_sourcestget_dependenciestis_local_src_dirtget_ext_source_filestget_script_filestget_lib_source_filestget_data_filestdot_joint	get_framet
minrelpathtnjointis_sequencet	is_stringtas_listtgpathstget_languaget
quote_argstget_build_architecturetget_infotget_pkg_infotInstallableLibcBseZdZd�ZRS(s�
    Container to hold information on an installable library.

    Parameters
    ----------
    name : str
        Name of the installed library.
    build_info : dict
        Dictionary holding build information.
    target_dir : str
        Absolute path specifying where to install the library.

    See Also
    --------
    Configuration.add_installed_library

    Notes
    -----
    The three parameters are stored as attributes with the same names.

    cCs||_||_||_dS(N(tnamet
build_infot
target_dir(tselfR,R-R.((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyt__init__8s		(t__name__t
__module__t__doc__R0(((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR+"scCsdt|�}xQtt|��D]=}||}d|kr|ddkrd|||<qqW|S(Nt is"'s"%s"(tlisttrangetlen(targstita((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR'=s
cCs|jd�}tjj|�S(sDConvert a /-separated pathname to one using the OS's path separator.t/(tsplittostpathtjoin(R,tsplitted((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR
GscCs�tjj|�}tjj|�}t|�t|�kr@|S||krPdS||t|� kr�|t|�tjgks�tt||t|�f���|t|�d}n|S(s)Return path relative to parent_path.
    ti(R=R>tabspathR7tseptAssertionErrortrepr(R>tparent_pathtpdtapath((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytrel_pathLs>cCs�y:td|j|j�}tjjtjj|��}Wn�tk
r�td|j|j�}t|�t	j
|}t|d�r�tjjtjj|j��}q�tjjd�}nX|dk	r�t||�}n|p�dS(s�Return path of the module given a frame object from the call stack.

    Returned path is relative to parent_path when given,
    otherwise it is absolute path.
    t__file__R1t.N(tevalt	f_globalstf_localsR=R>tdirnameRBt	NameErrort
__import__tsystmodulesthasattrRJtNoneRI(tframeRFtcaller_filetdtcaller_nametmod((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytget_path_from_frameZs"


$cGs�g}xO|D]G}t|�r5|jt|��q
t|�sGt�|j|�q
W|}|smd}ntjj|�}tjjdkr�|j	dtjj�}nt
|�S(s2Join two or more pathname components +
    - convert a /-separated pathname to one using the OS's path separator.
    - resolve `..` and `.` from path.

    Either passing n arguments as in njoin('a','b'), or a sequence
    of n names as in njoin(['a','b']) is handled, or a mixture of such arguments.
    RAR;(R"tappendR!R#RDR=R>R?RCtreplaceR (R>tpathstptjoined((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR!ys
	c	Cs|dk	r$tjj|d�}n^t�}xR|D]7}tjj|d�}tjj|�r4|}Pq4q4Wtd|f��t|�}g}d}x[|j�D]M}|j	|�r�|t
|�j�}|r�|j|j
d��q�q�q�W|j�|S(s/Return the MATHLIB line from numpyconfig.h
    s_numpyconfig.hs1_numpyconfig.h not found in numpy include dirs %rs#define MATHLIBt,N(RUR=R>R?RtexistsRtopent	readlinest
startswithR7tstriptextendR<tclose(	R>tconfig_filetdirstfntfidtmathlibststlinetvalue((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR�s(	

 
cCst|�s|Sd|kr |S|jtj�}x<|rpy|jdd�}Wntk
rePnX||=q5Wd}xn|r�y|jd|�}Wntk
r�PnX||ddkr�|d7}qz||=||d=d}qzW|s�dStjj|�S(s$Resolve `..` and '.' from path.
    RKis..RA(R#R<R=RCtindext
ValueErrorR?(R>tlR9tj((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR �s0	
	


cCs�t|�s$ttt|����g}t|�sItt|���xr|D]j}t|�r�d|kszd|kr�tj|�}tjt||��}|r�|j|�q�|r�|j|�q�|r�|j|�nd||fGHq�t||�}t	j
j|�r&|j|�q�t	j
j|�rH|j|�n|r^|j|�nt	j
j|�s�d||fGHq�qPt|�r�|jt|||��qP|j|�qPWg|D]}t
|�^q�S(Nt*t?s#could not resolve pattern in %r: %rsnon-existing path in %r: %r(R"RDREttypeR#tglobR!RgR\R=R>Rbt
_fix_pathsR (R^t
local_pathtinclude_non_existingt	new_pathstnR_tp2tn2((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyRy�s<$
RAcCs(t|�r|f}nt|||�S(s:Apply glob to paths and prepend local_path if needed.
    (R#Ry(R^RzR{((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR%�scCsYddlm}tsdS|jdt�ytjt�Wntk
rNnXdadS(Ni����(tlogsremoving %s(tnumpy.distutilsR�t_temporary_directorytdebugtshutiltrmtreetOSErrorRU(R�((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytclean_up_temporary_directory�s
c	Cshts"tj�atjt�ntjd|d|dtd|�\}}tj|d�}||fS(Ntsuffixtprefixtdirttexttw(	R�ttempfiletmkdtemptatexittregisterR�tmkstempR=tfdopen(R�R�R�RlR,tfo((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytmake_temp_filesc
Cstjdkr"dtjkr"dSttjd�rtjj�ry�ddl}|j�|j	d�dkr�|j	d�dkr�|j
d�dk	r�|j
d	�dk	s�|j
d
�dk	r�|j
d�dk	s�|j
d�dk	r�d
SWqtk
rqXndS(Ntcygwint	USE_COLORitisattyi����tcolorstpairstsetftsetbtsetaftsetabtscpi(
RRtplatformR=tenvironRTtstdoutR�tcursest	setuptermttigetnumttigetstrRUt	Exception(R�((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyRs"	!

tblackitreditgreenityellowitblueitmagentaitcyanitwhiteitdefaulti	cCs�g}|r|jd�n|rTdtj|j�d�}|jt|��n|r�dtj|j�d�}|jt|��n|r�ddj|�|fS|SdS(Nt1iii(is[%sm%st;(R\t
_colour_codestgettlowertstrR?(Rntfgtbgtboldtseqtfgcodetbgcode((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytcolour_text3scCs|S(N((RnR�R�((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR�BscCs
t|d�S(NR�(R�(Rn((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytdefault_textEscCs
t|d�S(NR�(R�(Rn((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR
GscCs
t|d�S(NR�(R�(Rn((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyRIscCs
t|d�S(NR�(R�(Rn((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyRKscCs
t|d�S(NR�(R�(Rn((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyRMscCs
t|d�S(NR�(R�(Rn((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyROscCsGtjdkrC|jd�rC|ddtjj|d�}n|S(NR�s	/cygdrivei
t:i(RRR�ReR=R>tnormcase(R>((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyRTs%cCsTtjdkrPtjjdd�dkr.tStjjdd�dkrPtSntS(s0Return true when using mingw32 environment.
    twin32tOSTYPERAtmsystMSYSTEMtMINGW32(RRR�R=R�R�tTruetFalse(((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyRYscCsxtjjd�}|dkrntj|d|d!}idd6dd6d	d
6dd6d
d6j|d�}nd}|S(sFReturn name of MSVC runtime library if Python was built with MSVC >= 7sMSC v.i����ii
tmsvcr70t1300tmsvcr71t1310tmsvcr80t1400tmsvcr90t1500tmsvcr100t1600N(RRtversiontfindR�RU(tmsc_postmsc_vertlib((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytmsvc_runtime_librarycs

cCs^tjdkptjdks"dSt�dkr5dSdtjkrHdSdGHdtjd<dS(NR�tnttAMD64tDISTUTILS_USE_SDKsForcing DISTUTILS_USE_SDK=1R�(RRR�R=R,R(R�(((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyt
msvc_on_amd64rs
s.*[.](cpp|cxx|cc)\Zs.*[.](f90|f95|f77|for|ftn|f)\Zs.*[.](f90|f95)\Zs\s*module\s*(?P<name>[\w_]+)cCs�t|�sgSg}t|d�}t|d|j�}xB|�D]7}t|�}|rD|jd�}|j|�qDqDW|j�|S(sRReturn a list of Fortran f90 module names that
    given source file defines.
    trt
xreadlinesR,(t
f90_ext_matchRctgetattrRdtf90_module_name_matchtgroupR\Rh(tsourceRStftf_readlinesRotmR,((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyt_get_f90_modules�s
cCs
t|t�S(N(t
isinstanceR�(Rn((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR#�scCs%x|D]}t|�stSqWtS(s4Return True if all items in lst are string objects. (R#R�R�(tlsttitem((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR�s
cCs-t|�rtSyt|�WntSXtS(N(R#R�R7R�(R�((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR"�scCs"t|�o!d|kp!d|kS(NRuRv(R#(Rn((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytis_glob_pattern�scCs!t|�rt|�S|gSdS(N(R"R5(R�((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR$�s
cCsXd}xK|D]C}t|t�r
t|�r8d}PqPt|�rPd}qPq
q
W|S(s2Determine language value (c,f77,f90) from sources tf90tf77N(RUR�R�R�tfortran_ext_match(tsourcestlanguageR�((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR&�s
cCs%x|D]}t|�rtSqWtS(s.Return True if sources contains Fortran files (R�R�R�(R�R�((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR�s
cCs%x|D]}t|�rtSqWtS(s*Return True if sources contains C++ files (t
cxx_ext_matchR�R�(R�R�((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR�s
cCs�g}g}g}g}xu|D]m}t|�rct|�}|rS|j|�q�|j|�qt|�r|j|�q|j|�qW||||fS(stReturn four lists of filenames containing
    C, C++, Fortran, and Fortran 90 module sources,
    respectively.
    (R�R�R\R�(R�t	c_sourcestcxx_sourcest	f_sourcestfmodule_sourcesR�RS((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR�s
cCsFg}x9|D]1}tjtjj|d��}|j|�q
W|S(Ns*.h(RxR=R>R?Rg(tdirectory_listtheadersRXthead((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyt_get_headers�s

cCsag}xT|D]L}tjj|�}|ddkr
|d|kr
|j|d�q
q
W|S(NiRA(R=R>R<R\(tlist_of_sourcestdirecsR�RX((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyt_get_directories�s
 cCstt|��S(N(R�R�(R�((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR�scCs�t|�stStjj|�}tjjtj�|g�}|t|�jtj	�}|rz|drz|d}n|r�|ddkr�tStj	j
|�}tjj|�S(s1Return true if directory is local directory.
    iitbuild(R#R�R=R>RBtcommonprefixtgetcwdR7R<RCR?tisdir(t	directorytabs_dirtctnew_dir((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR�s
c	cs�idd6dd6dd6}tjd�}x�tj|dt�D]r\}}}g|D]}||krV|^qV}||(x4|D],}|j|�s�tjj||�Vq�q�Wq@WdS(NitCVSs.svnR�s(?:[~#]|\.py[co]|\.o)$ttopdown(tretcompileR=twalkR�tsearchR>R?(	ttop_pathtpruned_directoriestprune_file_pattdirpathtdirnamest	filenamesRXtprunedR�((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytgeneral_source_files	s%%
c
cs�dddg}tjd�}x�tj|dt�D]�\}}}g|D]}||krJ|^qJ}||(x�|D]�}tjj||�}t||�}	g}
x^tj|�D]M}tjj||�}tjj	|�r�|j
|�r�|
j|�q�q�W|	|
fVqvWq4W|}t||�}	gtj|�D]*}|j
|�s?tjj||�^q?}g|D]}tjj	|�rv|^qv}
|	|
fVdS(sJReturn a directory name relative to top_path and
    files contained.
    Rs.svnR�s(?:[~#]|\.py[co]|\.o)$RN(RRR=RR�R>R?RItlistdirtisfileRR\(
R	R
RRR
RRXRtdpathtrpathtfilesR�Rk((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyt general_source_directories_filess(%%
"*+cCs�g}tt|j�}|j|�|jt|��x[|jD]P}t|�rp|jtt|���qBt	j
j|�rB|j|�qBqBW|S(N(
tfilterR#R�RgRtdependsRR5RR=R>RR\(textRR�RX((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR-s
cCstt|�}|S(N(RR#(tscripts((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR:scCs�g}|djdg�}tt|�}|j|�|jt|��|djdg�}xX|D]P}t|�r�|jtt|���qhtj	j
|�rh|j|�qhqhW|S(NiR�R(R�RR#RgRRR5RR=R>RR\(R�RR�RRX((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR>s

cCs`tjjd�pd}|r\dtjj�kr\|jdtjjd�dd�}n|S(s;Return the correct file extension for shared libraries.

    Parameters
    ----------
    is_python_ext : bool, optional
        Whether the shared library is a Python extension.  Default is False.

    Returns
    -------
    so_ext : str
        The shared library extension.

    Notes
    -----
    For Python shared libs, `so_ext` will typically be '.so' on Linux and OS X,
    and '.pyd' on Windows.  For Python >= 3.2 `so_ext` has a tag prepended on
    POSIX systems according to PEP 3149.  For Python 3.2 this is implemented on
    Linux, but not on OS X.

    tSORAtSOABIRKi(t	distutilst	sysconfigtget_config_vartget_config_varsR](t
is_python_exttso_ext((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytget_shared_lib_extensionLs(cCs�t|�r|gS|d}g}x�|D]�}t|d�rEq*nt|�rm|jtt|���q*t|�r�tjj|�r�|j	|�q�d|fGHq*t
t|���q*W|S(Nit__call__sNot existing data file:(R#RTRRgR5RR=R>RR\t	TypeErrorRE(tdataR�RRn((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyRis

cGs&djg|D]}|r
|^q
�S(NRK(R?(R8R:((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR|scCseytj|d�SWnItk
r`tj�dj}x!t|d�D]}|j}qIW|SXdS(s:Return frame object from call stack with given level.
    iiN(RRt	_getframetAttributeErrortexc_infottb_frameR6tf_back(tlevelRVt_((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyRs

t	SconsInfocBseZdZd�ZRS(s{
    Container object holding build info for building a package with scons.

    Parameters
    ----------
    scons_path : str or None
        Path to scons script, relative to the directory of setup.py.
        If None, no scons script is specified. This can be useful to add only
        pre- and post-hooks to a configuration.
    parent_name : str or None
        Name of the parent package (for example "numpy").
    pre_hook : sequence of callables or None
        Callables that are executed before scons is invoked.
        Each callable should be defined as ``callable(*args, **kw)``.
    post_hook : sequence of callables or None
        Callables that are executed after scons is invoked.
        Each callable should be defined as ``callable(*args, **kw)``.
    source_files : list of str or None
        List of paths to source files, relative to the directory of setup.py.
    pkg_path : str or None
        Path to the package for which the `SconsInfo` instance holds the
        build info, relative to the directory of setup.py.

    Notes
    -----
    All parameters are available as attributes of a `SconsInfo` instance.

    cCsj||_||_||_||_||_|r?||_n'|r]tjj|�|_n	d|_dS(NRA(	t
scons_pathtparent_nametpre_hookt	post_hooktsource_filestpkg_pathR=R>RO(R/R/R0R1R2R3R4((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR0�s					(R1R2R3R0(((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR.�sc
BseZdddddddddd	g
Zd
dgZdd
gZgZd:d:d:d:ddd�Zd�Zd�Z	d�Z
d�Zd�Zdd�Z
dd�Zd:d:dd�Zd:ed�Zd�Zd�Zd�Zd�Zd�Zd�Zd �Zd!�Zd"�Zd#�Zd$�Zd:d%�Zd:d&�Zd'�Zd:ed:d:d:d:d(�Z d)�Z!d*�Z"d+�Z#d,�Z$d-�Z%d.�Z&d/�Z'd0�Z(d1�Z)d2�Z*d:d:d3�Z+e,d4�Z-e,d5�Z.d6d7�Z/d6d8�Z0d9�Z1RS(;tpackagestext_modulest
data_filestinclude_dirst	librariesR�Rt
py_modulest
scons_datatinstalled_librariestpackage_dirtinstalled_pkg_configR,R�issetup.pyc
Ksut||�|_d|_t|�}t||�|_|dkrZ|j}d|_n|dkrr|j}n3tjj	t
|j|��r�t
|j|�}ntjj	|p�d�s�td|f��n||_||_
tjj|jjd��|_|j|_|j|_xB|jD]7}	tj|j|	g��}
t||	t|
��q*Wx<|jD]1}	tj|j|	i��}
t||	|
�qoW|j|j}|j|_x�|j�D]�}	|	|kr�q�n||	}t||	|�t|t�r"|jj|	�q�t|t�rD|jj|	�q�|jj|	�q�Wtjj t
|d��r�|j!j|j�||j"|j<ntdt#dt#dt#dt#�|_$d}
xmt%d	d
�D]\}yt|�}Wntk
r�PnXyt&d|j'|j(�}
PWq�t)k
r.q�Xq�Wt|
|j*�rh|
j$drh|j+|
j$�qhn||_,dS(
s�Construct configuration instance of a package.

        package_name -- name of the package
                        Ex.: 'distutils'
        parent_name  -- name of the parent package
                        Ex.: 'numpy'
        top_path     -- directory of the toplevel package
                        Ex.: the directory where the numpy package source sits
        package_path -- directory of package. Will be computed by magic from the
                        directory of the caller module if not specified
                        Ex.: the directory where numpy.distutils is
        caller_level -- frame level to caller namespace, internal parameter.
        RARKs%r is not a directorys__init__.pytignore_setup_xxx_pytassume_default_configurationtdelegate_options_to_subpackagestquietiiR/N(-RR,RUR�RR[RzR=R>R�R!RrR	tpackage_pathR?R<tpath_in_packaget
_list_keyst	list_keyst
_dict_keyst	dict_keystcopyR�tsetattrR$t_extra_keyst
extra_keystkeysR�R5R\tdictRbR5R=R�toptionsR6RLRMRNRPt	__class__tset_optionst
setup_name(R/tpackage_nameR0R	RCtcaller_levelRRtattrstcaller_frameR}tvt
known_keysR:tcaller_instanceR9R�((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR0�sv				!






cCs^|j�i}|j|j|j}x0|D](}t||�}|r.|||<q.q.W|S(s�
        Return a dictionary compatible with the keyword arguments of distutils
        setup function.

        Examples
        --------
        >>> setup(**config.todict())                           #doctest: +SKIP
        (t_optimize_data_filesRFRHRLR�(R/RXRXR}R:((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyttodict#s


cCs|jds|GHndS(NRB(RO(R/tmessage((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytinfo6s
cCstjjd|f�dS(NsWarning: %s(RRtstderrtwrite(R/R\((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytwarn:scKsPxI|j�D];\}}||jkr8||j|<q
td|��q
WdS(s�
        Configure Configuration instance.

        The following options are available:
         - ignore_setup_xxx_py
         - assume_default_configuration
         - delegate_options_to_subpackages
         - quiet

        sUnknown option: N(titemsRORr(R/ROtkeyRp((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyRQ=scCsddlm}|�S(s2Return the distutils distribution object for self.i����(tget_distribution(tnumpy.distutils.coreRc(R/Rc((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyRcNscCs�|jd�}t|jg|�}ttjjtj|��}g}x�|D]�}tjjt|d��swqPnd|jtj	�kr�qPndj
|jtj	�t|��}	|j|	d|d|d�}
|j
|
�qPW|S(NRKs__init__.pyR�R0RTi(R<R!RzRR=R>R�RxRRCR?R7tget_subpackageRg(R/tsubpackage_nameR0RTRstsubpackage_pathRjtconfig_listRXR}R((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyt_wildcard_get_subpackageSs
&
cs�tjjdtjj|��z�t|d�}tjjtjj|��d}t�j	||�}t
jdj|j
d��||d��|j�t�d�s��jds��jd	��nt||�j|d
|d�}	n�t|g|j
d�d �}
|
f}��fd�}��fd
�}
tjddkr`||�}n|
|�}�j|�}	|	j	t||�kr��jdt||�|	j	f�nWdtjd=X|	S(NitUR-RKs.pyit
configurationR@sCAssuming default configuration (%s does not define configuration())RTi����cs,�jjjdkr(|�jf}n|S(Ni(Rkt	func_codetco_argcountR	(R8(R/tsetup_module(s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytfix_args_py2�scs,�jjjdkr(|�jf}n|S(Ni(Rkt__code__RmR	(R8(R/Rn(s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytfix_args_py3�sis*Subpackage %r configuration returned as %r(s.pyRji(RRR>tinsertR=RORctsplitexttbasenameRR,timptload_moduleR?R<RhRTROR`RR	tversion_infoRk(R/tsetup_pyRfRgR0RTtfo_setup_pyRRR}tconfigtpnR8RoRq((R/Rns?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyt _get_configuration_from_setup_pyfs<"	

		 		!c	Cs�|dkr<|dkr'td��ntjj|�}n|jd�}|dkr}d|kr}|j||d|d�Sd|ks�tt|||f���|dkr�t	|j
g|�}n-t	|g|d �}|j|g�d}t	||j�}|j
ds@tjj|�s@t	|d	|�}q@ntjj|�s�|j
d
s�|jdtjj|�|f�nt|||j|d|d�}n"|j||||d|d�}|r�|gSgSdS(
sReturn list of subpackage configurations.

        Parameters
        ----------
        subpackage_name: str,None
            Name of the subpackage to get the configuration. '*' in
            subpackage_name is handled as a wildcard.
        subpackage_path: str
            If None, then the path is assumed to be the local path plus the
            subpackage_name. If a setup.py file is not found in the
            subpackage_path, then a default configuration is used.
        parent_name: str
            Parent name.
        s;either subpackage_name or subpackage_path must be specifiedRKRuRTii����iR?ssetup_%s.pyR@sEAssuming default configuration (%s/{setup_%s,setup}.py was not found)N(RURrR=R>RtR<RiRDRER!RzR^RRRORR`RORR	R|(R/RfRgR0RTRsRxRz((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyRe�sH	'

		
c	Cs|rd}n	|j}|j||d|dd�}|sL|jd�nx�|D]�}|}t|t�r}|j�}nt|t�s�tt	t
|����|jd|jd�|jf�|j
|�qSW|j�}|dk	r|jd|�ndS(	sAdd a sub-package to the current Configuration instance.

        This is useful in a setup.py script for adding sub-packages to a
        package.

        Parameters
        ----------
        subpackage_name: str
            name of the subpackage
        subpackage_path: str
            if given, the subpackage path such as the subpackage is in
            subpackage_path / subpackage_name. If None,the subpackage is
            assumed to be located in the local path / subpackage_name.
        standalone: bool
        R0RTis0No configuration returned, assuming unavailable.s Appending %s configuration to %sR,sTdistutils distribution has been initialized, it may be too late to add a subpackage N(RUR,ReR`R�RR[RNRDRERwR]R�RRc(	R/RfRgt
standaloneR0RhRzRXtdist((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytadd_subpackage�s(			
'		c
Cs�t|�r|\}}nd}t|�rWg|D]}|j||f�^q4dSt|�sytd|f��n|dkr�tjj|�r�|jtjj|�|f�S|j||f�S|j	|dt
�}t|�r�t|�r�t|�j
tj�}|j�tt|�d�}|j�x"|D]}||s?||=q?q?Wx�|D][}tjj|�s�d|fGHqdnt||j�}	|	j
tj�}
|
j�g}d}x�|D]�}t|�r|t|
�krtd||f��n|j|
|�nE||
|ksWtt||
|||||	f���|j|�|d7}q�W|
|r�|jd||
f�n|j�|jtjj|�|f�qdWn$x!|D]}|j||f�q�WdSt|�s
tt|���|j�}
|
dk	r@|
jdk	r@|
j}n	|j}x_|D]W}xNtt|��D]:\}}tjj|j||�}|j||f�qiWqPWdS(	s{Recursively add files under data_path to data_files list.

        Recursively add files under data_path to the list of data_files to be
        installed (and distributed). The data_path can be either a relative
        path-name, or an absolute path-name, or a 2-tuple where the first
        argument shows where in the install directory the data directory
        should be installed to.

        Parameters
        ----------
        data_path: seq,str
            Argument can be either

                * 2-sequence (<datadir suffix>,<path to data directory>)
                * path to data directory where python datadir suffix defaults
                  to package dir.

        Notes
        -----
        Rules for installation paths:
          foo/bar -> (foo/bar, foo/bar) -> parent/foo/bar
          (gun, foo/bar) -> parent/gun
          foo/* -> (foo/a, foo/a), (foo/b, foo/b) -> parent/foo/a, parent/foo/b
          (gun, foo/*) -> (gun, foo/a), (gun, foo/b) -> gun
          (gun/*, foo/*) -> parent/gun/a, parent/gun/b
          /foo/bar -> (bar, /foo/bar) -> parent/bar
          (gun, /foo/bar) -> parent/gun
          (fun/*/gun/*, sun/foo/bar) -> parent/fun/foo/gun/bar

        Examples
        --------
        For example suppose the source directory contains fun/foo.dat and
        fun/bar/car.dat::

            >>> self.add_data_dir('fun')                       #doctest: +SKIP
            >>> self.add_data_dir(('sun', 'fun'))              #doctest: +SKIP
            >>> self.add_data_dir(('gun', '/full/path/to/fun'))#doctest: +SKIP

        Will install data-files to the locations::

            <package install directory>/
              fun/
                foo.dat
                bar/
                  car.dat
              sun/
                foo.dat
                bar/
                  car.dat
              gun/
                foo.dat
                car.dat
        Nsnot a string: %rR{isNot a directory, skippingiscannot fill pattern %r with %rs,mismatch of pattern_list=%s and path_list=%s( R"RUtadd_data_dirR#R%R=R>tisabsRtR^R�R�R
R<RCtreverseR6R7R�RIRzRrR\RDRER`R?RcR7R5RRD(R/t	data_pathRXR_R^tpattern_listtrlR9R>Rt	path_listttarget_listRnR~R7td1R�ttarget_path((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR��sr6&






8

	
&
	
cCs�i}xU|jD]J\}}||kr8t�||<nx|D]}||j|�q?WqWg|j�D]\}}|t|�f^qk|j(dS(N(R7tsettaddRaR5(R/t	data_dictR_RR�((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyRZts
cGst|�dkr4x|D]}|j|�qWdSt|�dksLt�t|d�ro|d\}}nd}t|�r�|}nnt|�r�t|�dkr�|d}q�x!|D]}|j||f�q�WdSnttt|����|dkr`t	|d�rd}n-t
jj|�r7d}nt
jj
|�}|j||f�dS|j|dt�}t|�rwt|�r`|jt
j�}|j�x�|D]�}|jt
j�}|j�|j�g}	d}
xE|D]=}t|�r|	j||
�|
d7}
q�|	j|�q�W|	j�|jt
jj|	�|f�q�Wn|j||f�dSt|�s�tt||f���|j�}|dk	r�|jdk	r�|j}
n	|j}
|
jt
jj|j|�|f�dS(s�Add data files to configuration data_files.

        Parameters
        ----------
        files: sequence
            Argument(s) can be either

                * 2-sequence (<datadir prefix>,<path to data file(s)>)
                * paths to data files where python datadir prefix defaults
                  to package dir.

        Notes
        -----
        The form of each element of the files sequence is very flexible
        allowing many combinations of where to get the files from the package
        and where they should ultimately be installed on the system. The most
        basic usage is for an element of the files argument sequence to be a
        simple filename. This will cause that file from the local path to be
        installed to the installation path of the self.name package (package
        path). The file argument can also be a relative path in which case the
        entire relative path will be installed into the package directory.
        Finally, the file can be an absolute path name in which case the file
        will be found at the absolute path name but installed to the package
        path.

        This basic behavior can be augmented by passing a 2-tuple in as the
        file argument. The first element of the tuple should specify the
        relative path (under the package install directory) where the
        remaining sequence of files should be installed to (it has nothing to
        do with the file-names in the source distribution). The second element
        of the tuple is the sequence of files that should be installed. The
        files in this sequence can be filenames, relative paths, or absolute
        paths. For absolute paths the file will be installed in the top-level
        package installation directory (regardless of the first argument).
        Filenames and relative path names will be installed in the package
        install directory under the path name given as the first element of
        the tuple.

        Rules for installation paths:

          #. file.txt -> (., file.txt)-> parent/file.txt
          #. foo/file.txt -> (foo, foo/file.txt) -> parent/foo/file.txt
          #. /foo/bar/file.txt -> (., /foo/bar/file.txt) -> parent/file.txt
          #. *.txt -> parent/a.txt, parent/b.txt
          #. foo/*.txt -> parent/foo/a.txt, parent/foo/b.txt
          #. */*.txt -> (*, */*.txt) -> parent/c/a.txt, parent/d/b.txt
          #. (sun, file.txt) -> parent/sun/file.txt
          #. (sun, bar/file.txt) -> parent/sun/file.txt
          #. (sun, /foo/bar/file.txt) -> parent/sun/file.txt
          #. (sun, *.txt) -> parent/sun/a.txt, parent/sun/b.txt
          #. (sun, bar/*.txt) -> parent/sun/a.txt, parent/sun/b.txt
          #. (sun/*, */*.txt) -> parent/sun/c/a.txt, parent/d/b.txt

        An additional feature is that the path to a data-file can actually be
        a function that takes no arguments and returns the actual path(s) to
        the data-files. This is useful when the data files are generated while
        building the package.

        Examples
        --------
        Add files to the list of data_files to be included with the package.

            >>> self.add_data_files('foo.dat',
            ...     ('fun', ['gun.dat', 'nun/pun.dat', '/tmp/sun.dat']),
            ...     'bar/cat.dat',
            ...     '/full/path/to/can.dat')                   #doctest: +SKIP

        will install these data files to::

            <package install directory>/
             foo.dat
             fun/
               gun.dat
               nun/
                 pun.dat
             sun.dat
             bar/
               car.dat
             can.dat

        where <package install directory> is the package (or sub-package)
        directory such as '/usr/lib/python2.4/site-packages/mypackage' ('C:
        \Python2.4 \Lib \site-packages \mypackage') or
        '/usr/lib/python2.4/site- packages/mypackage/mysubpackage' ('C:
        \Python2.4 \Lib \site-packages \mypackage \mysubpackage').
        iNiR$RAR{(R7tadd_data_filesRDR"RUR#R%RERwRTR=R>R�ROR^R�R�R<RCR�tpopR\R?RcR7RD(R/RR�RXtfilepatR^R�R>R�R�R9RnR~R7((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR�}sfX
	

		






&%	cGsi|j|�}|j�}|dk	rU|jdkrBg|_n|jj|�n|jj|�dS(s�Add paths to configuration include directories.

        Add the given sequence of paths to the beginning of the include_dirs
        list. This list will be visible to all extension modules of the
        current package.
        N(R^RcRUR8Rg(R/R^R8R~((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytadd_include_dirsscCs)ddljj}|j|j��dS(Ni����(tnumpy.numarray.utiltnumarraytutilR�tget_numarray_include_dirs(R/tnnu((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytadd_numarray_include_dirs&scGs&g}x�|D]�}t|�rTg|j|�D]}|j|j|f�^q/q
t|ttf�s|t|�dkr�tt	|���ng|j|d�D]}|j|d|f�^q�q
W|j
�}|dk	r|jdkr�g|_n|jj
|�n|jj
|�dS(s�Add installable headers to configuration.

        Add the given sequence of files to the beginning of the headers list.
        By default, headers will be installed under <python-
        include>/<self.name.replace('.','/')>/ directory. If an item of files
        is a tuple, then its first argument specifies the actual installation
        location relative to the <python-include> path.

        Parameters
        ----------
        files: str, seq
            Argument(s) can be either:

                * 2-sequence (<includedir suffix>,<path to header file(s)>)
                * path(s) to header file(s) where python includedir suffix will
                  default to package name.
        iiiN(R#R^R\R,R�ttupleR5R7R%RERcRUR�Rg(R/RR�R>R_R~((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytadd_headers*s
5(;cOs+|jdt�}t|d|jd|�S(s�Apply glob to paths and prepend local_path if needed.

        Applies glob.glob(...) to each path in the sequence (if needed) and
        pre-pends the local_path if needed. Because this is called on all
        source lists, this allows wildcard characters to be specified in lists
        of sources for extension modules and libraries and scripts and allows
        path-names be relative to the source directory.

        R{Rz(R�R�R%Rz(R/R^tkwsR{((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR^Ls
		cCsMxF|j�D]8}||}|dkr
|j|�}|||<q
q
WdS(NR�RR8tlibrary_dirstmodule_dirst
extra_objects(ssourcessdependssinclude_dirsR�R�R�(RMR^(R/tkwtkRWtnew_v((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyt_fix_paths_dict[s
	cKs�tj|�}t|j|�|d<||d<d|kr�|d}|d=t|t�rg|g}nx?|D]4}t|t�s�tt|���t||�qnWn|j|�|j	dg�}g}g|d<xH|D]@}	t|	t
�r|j|	d�nd|	kr|	jdd�\}
}tj
jt|j|��}tj
j|�r|jd|dd�}t|t�r�|j�}nxtg|j	dg�D]}
|
d	^q�D]I}
|
jd
d�d	}||
kr�|jdd�t||�Pq�q�Wq�qn|j|	�q�W||d|d<ddlm}||�}|jj|�|j�}|dk	r�|jd
|�n|S(s�Add extension to configuration.

        Create and add an Extension instance to the ext_modules list. This
        method also takes the following optional keyword arguments that are
        passed on to the Extension constructor.

        Parameters
        ----------
        name: str
            name of the extension
        sources: seq
            list of the sources. The list of sources may contain functions
            (called source generators) which must take an extension instance
            and a build directory as inputs and return a source file or list of
            source files or None. If None is returned then no sources are
            generated. If the Extension instance has no sources after
            processing all source generators, then no extension module is
            built.
        include_dirs:
        define_macros:
        undef_macros:
        library_dirs:
        libraries:
        runtime_library_dirs:
        extra_objects:
        extra_compile_args:
        extra_link_args:
        extra_f77_compile_args:
        extra_f90_compile_args:
        export_symbols:
        swig_opts:
        depends:
            The depends list contains paths to files or directories that the
            sources of the extension module depend on. If any path in the
            depends list is newer than the extension module, then the module
            will be rebuilt.
        language:
        f2py_options:
        module_dirs:
        extra_info: dict,list
            dict or list of dict of keywords to be appended to keywords.

        Notes
        -----
        The self.paths(...) method is applied to all lists that may contain
        paths.
        R,R�t
extra_infoR9it@RTiit__OF__i����(t	ExtensionsTdistutils distribution has been initialized, it may be too late to add an extension N(RIRR,R�RNRDRERR�R�R�R<R=R>RBR!RzR�ReRURR[R�R\RdR�R6RcR`(R/R,R�R�text_argsR�R]R9tlibnamestlibnametlnametlpathRRstllnameR�RR~((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyt
add_extensioncsV0


!


	0
		cKsF|j||d|�|j�}|dk	rB|jd|�ndS(s�
        Add library to configuration.

        Parameters
        ----------
        name : str
            Name of the extension.
        sources : sequence
            List of the sources. The list of sources may contain functions
            (called source generators) which must take an extension instance
            and a build directory as inputs and return a source file or list of
            source files or None. If None is returned then no sources are
            generated. If the Extension instance has no sources after
            processing all source generators, then no extension module is
            built.
        build_info : dict, optional
            The following keys are allowed:

                * depends
                * macros
                * include_dirs
                * extra_compiler_args
                * extra_f77_compiler_args
                * extra_f90_compiler_args
                * f2py_options
                * language

        sQdistutils distribution has been initialized, it may be too late to add a library N(t_add_libraryRURcR`(R/R,R�R-R~((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytadd_library�s
	cCs_tj|�}|}||d<d|kr8g|d<n|j|�|jj||f�dS(s\Common implementation for add_library and add_installed_library. Do
        not use directlyR�RN(RIR�R9R\(R/R,R�tinstall_dirR-((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR��s


cCs]|si}ntjj|j|�}|j||||�|jjt|||��dS(sS
        Similar to add_library, but the specified library is installed.

        Most C libraries used with `distutils` are only used to build python
        extensions, but libraries built through this method will be installed
        so that they can be reused by third-party packages.

        Parameters
        ----------
        name : str
            Name of the installed library.
        sources : sequence
            List of the library's source files. See `add_library` for details.
        install_dir : str
            Path to install the library, relative to the current sub-package.
        build_info : dict, optional
            The following keys are allowed:

                * depends
                * macros
                * include_dirs
                * extra_compiler_args
                * extra_f77_compiler_args
                * extra_f90_compiler_args
                * f2py_options
                * language

        Returns
        -------
        None

        See Also
        --------
        add_library, add_npy_pkg_config, get_info

        Notes
        -----
        The best way to encode the options required to link against the specified
        C libraries is to use a "libname.ini" file, and use `get_info` to
        retrieve the required options (see `add_npy_pkg_config` for more
        information).

        N(R=R>R?RCR�R<R\R+(R/R,R�R�R-((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytadd_installed_library�s
,	cCs�|dkri}ntjj|�d}tjj|j|�}|j|jkrx|j|jj|||f�n|||fg|j|j<dS(s�
        Generate and install a npy-pkg config file from a template.

        The config file generated from `template` is installed in the
        given install directory, using `subst_dict` for variable substitution.

        Parameters
        ----------
        template : str
            The path of the template, relatively to the current package path.
        install_dir : str
            Where to install the npy-pkg config file, relatively to the current
            package path.
        subst_dict : dict, optional
            If given, any string of the form ``@key@`` will be replaced by
            ``subst_dict[key]`` in the template file when installed. The install
            prefix is always available through the variable ``@prefix@``, since the
            install prefix is not easy to get reliably from setup.py.

        See also
        --------
        add_installed_library, get_info

        Notes
        -----
        This works for both standard installs and in-place builds, i.e. the
        ``@prefix@`` refer to the source directory for in-place builds.

        Examples
        --------
        ::

            config.add_npy_pkg_config('foo.ini.in', 'lib', {'foo': bar})

        Assuming the foo.ini.in file has the following content::

            [meta]
            Name=@foo@
            Version=1.0
            Description=dummy description

            [default]
            Cflags=-I@prefix@/include
            Libs=

        The generated file will have the following content::

            [meta]
            Name=bar
            Version=1.0
            Description=dummy description

            [default]
            Cflags=-Iprefix_dir/include
            Libs=

        and will be installed as foo.ini in the 'lib' subpath.

        iN(	RUR=R>RsR?RCR,R>R\(R/ttemplateR�t
subst_dictRt((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytadd_npy_pkg_config0s<	
cCs8tjj|j|�}|jjt|i|��dS(s

        Add a scons-built installable library to distutils.

        Parameters
        ----------
        name : str
            The name of the library.
        install_dir : str
            Path to install the library, relative to the current sub-package.

        N(R=R>R?RCR<R\R+(R/R,R�((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytadd_scons_installed_libraryxscCs|rd}n	|j}|j�}	|j|�d}
g}|rs|jg|D]}|j|�d^qP�nt|
|||||�}
|	dk	r�|	jdkr�g|	_n|	jj|
�|jdt	�|	j
ddg�n#|jj|
�|j
ddg�dS(shAdd a sconscript to configuration.

        pre_hook and post hook should be sequences of callable, which will be
        use before and after executing scons. The callable should be defined as
        callable(*args, **kw). It is ugly, but well, hooks are ugly anyway...

        sconscript can be None, which can be useful to add only post/pre
        hooks.isTdistutils distribution has been initialized, it may be too late to add a subpackage RAR�N(RUR,RcR^RgR.R;R\R`RfR�(R/t
sconscriptRgR}R1R2R3RCR0R~t
fullsconsnametfull_source_filesR9t
scons_info((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytadd_sconscript�s(		0		cGsi|j|�}|j�}|dk	rU|jdkrBg|_n|jj|�n|jj|�dS(s�Add scripts to configuration.

        Add the sequence of files to the beginning of the scripts list.
        Scripts will be installed under the <prefix>/bin/ directory.

        N(R^RcRURRg(R/RRR~((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytadd_scripts�sc	Ks�x9|jD].}t||�}|j|j|g��q
Wx9|jD].}t||�}|j|j|i��qFW|j|j|j}x�|j�D]�}||kr-t||d�}|r�|||kr�q�n|j	d||||jdd�f�t
||||�|jj|�q�||jkrf|jd|t||�||f�q�||kruq�t
d|��q�WdS(Ns"Inheriting attribute %r=%r from %rR,Rvs*Ignoring attempt to set %r (from %r to %r)sDon't know about key=%r(RFR�RgR�RHtupdateRLRMRUR`RJR\R]Rr(R/RNRbR:RX((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR�s,	!	!cCs�ddlm}|j|j|j}ddd}|d|jd7}|j�xC|D];}t||d�}|r[|d	|||�f7}q[q[W|d
7}|S(Ni����(tpformatt<it-s
sConfiguration of s:
s%s = %s
t>s-----s-----s----->(	tpprintR�RFRHRLR,tsortR�RU(R/R�RXRnR�R:((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyt__str__�s

!
cCsltd�}|j�d|_d|_tjjd�}|rhtjjd|g�}|tjd<n|S(sF
        Returns the numpy.distutils config command instance.
        RzitPATHRK(	R	tensure_finalizedtdump_sourcetnoisyR=R�R�tpathsepR?(R/tcmdtold_pathR>((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytget_config_cmd�s
		cCstd�}|j�|jS(sh
        Return a path to a temporary directory where temporary files should be
        placed.
        R�(R	R�t
build_temp(R/R�((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytget_build_temp_dir�s
cCs+d}|j�}|j|dd�}|S(sSCheck for availability of Fortran 77 compiler.

        Use it inside source generating function to ensure that
        setup distribution instance has been initialized.

        Notes
        -----
        True if a Fortran 77 compiler is available (because a simple Fortran 77
        code was able to be compiled successfully).
        s/
        subroutine simple
        end
        tlangR�(R�ttry_compile(R/tsimple_fortran_subroutinet
config_cmdtflag((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyt	have_f77cscCs+d}|j�}|j|dd�}|S(sRCheck for availability of Fortran 90 compiler.

        Use it inside source generating function to ensure that
        setup distribution instance has been initialized.

        Notes
        -----
        True if a Fortran 90 compiler is available (because a simple Fortran
        90 code was able to be compiled successfully)
        s/
        subroutine simple
        end
        R�R�(R�R�(R/R�R�R�((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyt	have_f90cscCs�t|�r7|\}}t|d|jd|j�nWddlm}t||�shtt|���|jj	|j�|jj	|j�dS(sEAppend libraries, include_dirs to extension or library item.
        R9R8i����(R�N(
R"RR9R8RdR�R�RDRERg(R/textlibtlib_nameR-R�((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyt	append_to's		
!c
Cs�d}d}tj�}yetj|p*d�tjdgdtdtjdddt�}|j}t	j
d|j��}WnnXtj|�|r�t|j
d��}|Stjd	kr�tjjd
d�r�t|dd�}nt|d
d�}tjj|�r�t|�}|j�}	|j�|	d dkrut	jd|	�}|r�t|j
d��}q�q�t	jd|	�}|r�t|j
d��}q�n|S(s+Return path's SVN revision number.
        RKt
svnversiontshellR�R^t	close_fdss(?P<revision>\d+)trevisionR�tSVN_ASP_DOT_NET_HACKt_svntentriess.svnis<?xmlsrevision="(?P<revision>\d+)"sdir[\n\r]+(?P<revision>\d+)N(RUR=R�tchdirt
subprocesstPopenR�tPIPER�RtmatchtreadtintR�RRR�R�R�R!R>RRcRhR(
R/R>R�R�tcwdR_tsoutR�R�tfstr((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyt_get_svn_revision5s>		
$
cCs�d}d}tj�}yetj|p*d�tjdgdtdtjdddt�}|j}t	j
d|j��}WnnXtj|�|r�t|j
d��}|St|d	d
�}t|d	d�}tjj|�r�d}	t|�}
|
j�j�}|
j�i}xst|d�D]b}
|
j�d
 \}}||kr^|}	nyt|�}Wntk
r�q-nX|||<q-W|j|	�}n|S(s1Return path's Mercurial revision number.
        RKshg identify --numR�R�R^R�s(?P<revision>\d+)R�s.hgtbranchsbranch.cacheR�iN(RUR=R�R�R�R�R�R�R�RR�R�R�R�R!R>RRcRfRhtfileR<RrR�(R/R>R�R�R�R_R�t	branch_fntbranch_cache_fntbranch0R�t	revision0t
branch_mapRotbranch1t	revision1((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyt_get_hg_revisionZsF		

	
cCsFt|dd�}|dk	r"|S|dkrZd|jjd�dddddg}n	|g}|dkr�dd	|jjd�dd
g}n	|g}x1|D])}t|j|�}tjj|�r�t	|�|df}tjj
tjj|��d}	t|j|	�}
y(t
jdj|
jd��|�}Wn3tk
rut�}|jt|��d}nX|dkr�q�nx0|D](}
t||
d�}|dk	r�Pq�q�W|dk	r�Pq�q�q�W|dk	r�||_|S|j|j�}|dkr|j|j�}n|dk	rBt|�}||_n|S(s�Try to get version string of a package.

        Return a version string of the current package or None if the version
        information could not be detected.

        Notes
        -----
        This method scans files named
        __version__.py, <packagename>_version.py, version.py, and
        __svn_version__.py for string variables version, __version\__, and
        <packagename>_version, until a version number is found.
        R�s__version__.pyRKi����s_version.pys
version.pys__svn_version__.pys__hg_version__.pyt__version__t_versions.pyRjiiR-N(s.pyRji(R�RUR,R<R!RzR=R>RRcRsRtRRuRvR?tImportErrorRR`R�R�R�R�(R/tversion_filetversion_variableR�Rtversion_varsR�RkR]R,R}tversion_moduletmsgR:R�((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytget_version�sZ
	 	
"(
	

	csxt�jd���j�j��tjj��sB�dkrFdS����fd�}�jd|�f�dS(sAppends a data function to the data_files list that will generate
        __svn_version__.py file to the current package directory.

        Generate package __svn_version__.py file from SVN revision number,
        it will be removed after python exits but will be available
        when sdist, etc commands are executed.

        Notes
        -----
        If __svn_version__.py existed before, nothing is done.

        This is
        intended for working with source directories that are in an SVN
        repository.
        s__svn_version__.pyNcs�tjj��sbt��}�jd�|f�t�d�}|jd|�|j�nddl}��j�fd�}|j	|��S(NsCreating %s (version=%r)R�s
version = %r
i����cs{�rwytj|�|d|�Wntk
r8nXy'tj|d�|d|d�Wqwtk
rsqwXndS(Nsremoved R(R=tremoveR�(R�R_(tdelete(s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytrm_file�s


(
R=R>RR�R]RcR_RhR�R�(R�R�R�R�(R�R�R/ttarget(s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytgenerate_svn_version_py�s

RA(R!RzR�R=R>RRUR�(R/R�R�((R�R�R/R�s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytmake_svn_version_py�scsxt�jd���j�j��tjj��sB�dkrFdS����fd�}�jd|�f�dS(sAppends a data function to the data_files list that will generate
        __hg_version__.py file to the current package directory.

        Generate package __hg_version__.py file from Mercurial revision,
        it will be removed after python exits but will be available
        when sdist, etc commands are executed.

        Notes
        -----
        If __hg_version__.py existed before, nothing is done.

        This is intended for working with source directories that are
        in an Mercurial repository.
        s__hg_version__.pyNcs�tjj��sbt��}�jd�|f�t�d�}|jd|�|j�nddl}��j�fd�}|j	|��S(NsCreating %s (version=%r)R�s
version = %r
i����cs{�rwytj|�|d|�Wntk
r8nXy'tj|d�|d|d�Wqwtk
rsqwXndS(Nsremoved R(R=R�R�(R�R_(R�(s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR�s


(
R=R>RR�R]RcR_RhR�R�(R�R�R�R�(R�R�R/R�(s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytgenerate_hg_version_py	s

RA(R!RzR�R=R>RRUR�(R/R�R((R�R�R/R�s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytmake_hg_version_py�st
__config__cCs |jj|j|tf�dS(s�Generate package __config__.py file containing system_info
        information used during building the package.

        This file is installed to the
        package installation directory.

        N(R:R\R,R(R/R,((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytmake_config_pyscCs |jj|j|tf�dS(syGenerate package __config__.py file containing system_info
        information used during building the package.
        N(R:R\R,tscons_generate_config_py(R/R,((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytscons_make_config_py)scGsDddlm}m}i}x!|D]}||||��q#W|S(s�Get resources information.

        Return information (from system_info.get_info) for all of the names in
        the argument list in a single dictionary.
        i����(R)R(tsystem_infoR)R(R/tnamesR)Rt	info_dictR:((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR)/s

N(2R1R2RERGRKtnumpy_include_dirsRUR0R[R]R`RQRcRiR|ReR�RR�RZR�R�R�R�R^R�R�R�R�R�R�R�R�R�RR�R�R�R�R�R�R�R�R�R�RRRRR)(((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR�sr	[					,;)	w			�			"			e	$	3H	+			
							%	+E+*
cCss||krkddl}|jj}|dkrOddlm}|d��n|j|�}|||<n||S(Ni����(tDistutilsInternalErrors+setup distribution instance not initialized(tdistutils.coretcoret_setup_distributionRUtdistutils.errorsRtget_command_obj(tcmdnamet_cacheRR~RR�((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR	<s
cCs2tj}|s.ddl}|j�g}n|S(Ni����(RR
tnumpytget_include(R8R((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyRHs

cCs:ddl}tjjtjj|j�ddd�}|S(s;Return the path where to find the npy-pkg-config directory.i����NR
R�snpy-pkg-config(RR=R>R?RORJ(RRX((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytget_npy_pkg_dirQscCsBddlm}|r)|jt��nt�g}|||�S(s�
    Return library info for the given package.

    Parameters
    ----------
    pkgname : str
        Name of the package (should match the name of the .ini file, without
        the extension, e.g. foo for the file foo.ini).
    dirs : sequence, optional
        If given, should be a sequence of additional directories where to look
        for npy-pkg-config files. Those directories are searched prior to the
        NumPy directory.

    Returns
    -------
    pkginfo : class instance
        The `LibraryInfo` instance containing the build information.

    Raises
    ------
    PkgNotFound
        If the package is not found.

    See Also
    --------
    Configuration.add_npy_pkg_config, Configuration.add_installed_library,
    get_info

    i����(tread_config(tnumpy.distutils.npy_pkg_configRR\R(tpkgnameRjR((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR*Ys
cCs�ddlm}t||�}||j��}x7||j��j�D]\}}||j|�qJW|d|d<|d=|d=|S(s9
    Return an info dict for a given C library.

    The info dict contains the necessary options to use the C library.

    Parameters
    ----------
    pkgname : str
        Name of the package (should match the name of the .ini file, without
        the extension, e.g. foo for the file foo.ini).
    dirs : sequence, optional
        If given, should be a sequence of additional directories where to look
        for npy-pkg-config files. Those directories are searched prior to the
        NumPy directory.

    Returns
    -------
    info : dict
        The dictionary with build information.

    Raises
    ------
    PkgNotFound
        If the package is not found.

    See Also
    --------
    Configuration.add_npy_pkg_config, Configuration.add_installed_library,
    get_pkg_info

    Examples
    --------
    To get the necessary information for the npymath library from NumPy:

    >>> npymath_info = np.distutils.misc_util.get_info('npymath')
    >>> npymath_info                                    #doctest: +SKIP
    {'define_macros': [], 'libraries': ['npymath'], 'library_dirs':
    ['.../numpy/core/lib'], 'include_dirs': ['.../numpy/core/include']}

    This info dict can then be used as input to a `Configuration` instance::

      config.add_extension('foo', sources=['foo.c'], extra_info=npymath_info)

    i����(tparse_flagstmacrost
define_macrostignored(RRR*tcflagstlibsRaRg(RRjRtpkg_infoR]R�RW((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR)s-%cCs=ddl}y|jtSWntk
r8tSt}nXdS(Ni����(t__builtin__t__NUMPY_SETUP__R�R(R�(R R!((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytis_bootstrapping�s
cCs�ddlm}ddlm}m}i}|tjj|��t|d�}|j	dtjj
tjd��|j	d�|j	d�|�}|�}x�tj
|�D]�\}}	}
|
r�tjj||�}|j|�s�t�d	j|t|�d
jtj��}t|d�}
z |
j�}t|�||<Wd|
j�Xq�q�W|j	d
|�|j	d�|j�|S(s�generate config.py file containing system_info information
    used during building the package.

    usage:
        config['py_modules'].append((packagename, '__config__',generate_config_py))
    i����(tmkpath(tget_scons_configres_dirtget_scons_configres_filenameR�s# this file is generated by %s
isH# it contains system_info results at the time of building this package.
s__all__ = ["show"]

RKiR�Ns
_config = %s
s
def show():
    for pkg, config in _config.items():
        print("package %s configuration:" % pkg)
        for lib, libc in config.items():
            print('    %s' % lib)
            for line in libc.split('\n'):
                print('\t%s' % line)
    (tdistutils.dir_utilR#tnumsconsR$R%R=R>RORcR_RBRRtargvRR?ReRDR7R<RCR�RLRh(R�R#R$R%RXR�tconfdirtconfilenametrootRjRR�tpkg_nameRltcnt((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR�s2$

		)
cCsKddl}|jd||||||f�t|||�}|j�S(sqReturn a configuration dictionary for usage in
    configuration() function defined in file setup_<name>.py.
    i����NsXUse Configuration(%r,%r,top_path=%r) instead of deprecated default_config_dict(%r,%r,%r)(twarningsR`RR[(R,R0RzR.R((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR�s		cKsqxj|j�D]\\}}||kr_||}t|t�rK|||<qi||j|�q
|||<q
WdS(N(RaR�R�Rg(RXR�R�RWtov((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR	s

cCs�tjjdkrE|jdtjj�}|jdtjj�}nd}tjj|�rjtjj|�d}tjjtjj|��d}tjj|�\}}tjj||g�}tjj|t	|� |t	|��|ks#tjj|t	|� |t	|��|kr8tjj
|�}n|t	|�}tjj|�rp|d}qpn|}tjjt|||��S(NR;RAii(
R=R>RCR]R�t
splitdriveRBR�R?R7ROtnormpathR!(R�R>tdrivet	absprefixt	pathdriveRXtsubpath((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR	s""//cCs�ddlm}ddlm}|tjj|��t|d�}|jdtjj	t
jd��|jd�|jd�x4|jj
�D]#\}}|jd	||f�q�W|jd
�|j�|S(s�Generate config.py file containing system_info information
    used during building the package.

    Usage:
        config['py_modules'].append((packagename, '__config__',generate_config_py))
    i����(R(R#R�s# This file is generated by %s
isH# It contains system_info results at the time of building this package.
s__all__ = ["get_info","show"]

s%s=%r
s
def get_info(name):
    g = globals()
    return g.get(name, g.get(name + "_info", {}))

def show():
    for name,info_dict in globals().items():
        if name[0] == "_" or type(info_dict) is not type({}): continue
        print(name + ":")
        if not info_dict:
            print("  NOT AVAILABLE")
        for k,v in info_dict.items():
            v = str(v)
            if k == "sources" and len(v) > 200:
                v = v[:60] + " ...\n... " + v[-60:]
            print("    %s = %s" % (k,v))
    (tnumpy.distutils.system_infoRR&R#R=R>RORcR_RBRRR(t
saved_resultsRaRh(R�RR#R�R�R9((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR 	s$


cCs,|jdks%td|j��n|jS(sdReturn version major and minor of compiler instance if it is
    MSVC, raise an exception otherwise.tmsvcs"Compiler instance is not msvc (%s)(t
compiler_typeRrt_MSVCCompiler__version(tcompiler((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pytmsvc_versionE	ss2.5cCsddlm}|�S(Ni����(R((tdistutils.msvccompilerR((R(((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR(N	scCsUd}tjj|�}|dkr(dStjjd|�}tj|t|�|!S(siReturn the processor architecture.

        Possible results are "Intel", "Itanium", or "AMD64".
        s bit (i����tIntelt)(RRR�R�R7(R�R9Rt((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyR(S	s(aR=RRRRuRIRxR�R�R�R�RRRR�RPtsetsRtnumpy.distutils.compatRt__all__tobjectR+R'R
RIRUR[R!RR RyR�R%R�R�R�RRNR�R�R�R�R
RRRRRRR�R�RtIR�R�R�R�R�R�R#RR"R�R$R&RRRR�R�RRRRRRRR#RRRR.RR	RRR*R)R"RRRRRR<R�R((((s?/usr/lib64/python2.7/site-packages/numpy/distutils/misc_util.pyt<module>s�
							
					%			!								
										
									
		
				.������			&<			.			%