3 fa @sdZddlZddlZddlmZmZdddddd d d d d dg Zdddddddddddddddddddddddddddd d d!d!d"d#d$d%d&d&d'd(d)d*d$d%d+d+d,d,d-d*d$d%d.ZdoZej j dZ d6ej dd7Z d8ej dd7ZejjejZejjejZejjejZejjejZdadZd9d:ZejrPejjeejZn eejZej d;krej!j"dpreejj#eeeZd>ej$kreej$d>Zd?d@Z%e&edAdZ'e'rej d;kre'j!j"dqrejjejje'Z'drdCdDZ(e(dEZ)e)r0x&dsD]Z*dHee*d3<dIee*dJ<qWdKdLZ+dMdNZ,dOdPZ-dQdRZ.dSdTZ/dtdUdVZ0dWdZ1dXdYZ2dZd[Z3d\d]Z4d^d_Z5dud`dZ6dadZ7dbd Z8dcd Z9e.ddEfddd Z:e.ddEfdedZ;dfdZdid Z?djdkZ@dldmZAeBdnkreAdS)vz-Access to Python's configuration information.N)pardirrealpathget_config_h_filenameget_config_varget_config_varsget_makefile_filenameget_pathget_path_names get_paths get_platformget_python_versionget_scheme_namesparse_config_hz/{installed_base}/lib64/python{py_version_short}z){platbase}/lib64/python{py_version_short}z1{base}/lib/python{py_version_short}/site-packagesz7{platbase}/lib64/python{py_version_short}/site-packagesz;{installed_base}/include/python{py_version_short}{abiflags}z?{installed_platbase}/include/python{py_version_short}{abiflags}z {base}/binz{base})stdlib platstdlibpurelibplatlibinclude platincludescriptsdataz{installed_base}/lib/pythonz{base}/lib/pythonz{installed_base}/include/pythonz{installed_base}/Libz {base}/Libz{base}/Lib/site-packagesz{installed_base}/Includez{base}/Scriptsz#{userbase}/Python{py_version_nodot}z1{userbase}/Python{py_version_nodot}/site-packagesz+{userbase}/Python{py_version_nodot}/Includez+{userbase}/Python{py_version_nodot}/Scriptsz {userbase})rrrrrrrz){userbase}/lib64/python{py_version_short}z5{userbase}/lib/python{py_version_short}/site-packagesz7{userbase}/lib64/python{py_version_short}/site-packagesz+{userbase}/include/python{py_version_short}z{userbase}/binz{userbase}/lib/pythonz#{userbase}/lib/python/site-packagesz{userbase}/include) posix_prefix posix_homentnt_user posix_userosx_framework_userrrrrrrrz%d.%dz%d%dc Cs"yt|Stk r|SXdS)N)rOSError)pathr !/usr/lib64/python3.6/sysconfig.py_safe_realpathcsr"r\pcbuild\win32\pcbuild\amd64Z_PYTHON_PROJECT_BASEcCs.x(dD] }tjjtjj|d|rdSqWdS)N Setup.dist Setup.localModulesTF)r%r&)osrisfilejoin)dfnr r r!_is_python_source_dirxs r-_homeFcCs|rtrttSttS)N) _sys_homer- _PROJECT_BASE) check_homer r r!is_python_buildsr2Trrz{srcdir}/Includez{projectbase}/.rcCsdy |jf|Stk r^y|jftjStk rX}ztd|WYdd}~XnXYnXdS)Nz{%s})formatKeyErrorr(environAttributeError)s local_varsvarr r r! _subst_varss r:cCs4|j}x&|jD]\}}||kr$q|||<qWdS)N)keysitems) target_dict other_dict target_keyskeyvaluer r r! _extend_dicts rBcCsfi}|dkri}t|txDt|jD]4\}}tjdkrHtjj|}tjjt ||||<q*W|S)Nposixr)rCr) rBr_INSTALL_SCHEMESr<r(namer expandusernormpathr:)schemevarsresr@rAr r r! _expand_varss   rKcCstjdkrdStjS)NrCr)r(rEr r r r!_get_default_schemes rLcCstjjdd}dd}tjdkrBtjjdp.d}|r8|S||dStjdkr|td }|r||r`|S|dd |d tjdd S|r|S|dd SdS)NPYTHONUSERBASEcWstjjtjj|S)N)r(rrFr*)argsr r r!joinusersz_getuserbase..joinuserrAPPDATA~PythondarwinPYTHONFRAMEWORKLibraryz%d.%drz.local)r(r5getrEsysplatformr version_info)env_baserObase frameworkr r r! _getuserbases"    r]cCspddl}|jd}|jd}|jd}|dkr2i}i}i}t|dd}|j} WdQRXx| D]} | jds`| jd kr|q`|j| } | r`| jd d \} } | j} | jd d }d |kr| || <q`y t | } Wn$t k r| jd d || <Yq`X| || <q`Wt |j }d}x t |dkr0xt|D]}||}|j|}|j|}|rv|rv|j|jkrp|n|} n|r|n|} | dk r| jd } d}| |krt|| }n| |krd}nx| tjkrtj| }n`| |kr0|jdr |dd|kr d }n$d| |krd}nt|d| }n d || <}|r&|| jd}|d| j}|j|krx||7}||7}d |kr|||<n~y t |}Wn"t k r|j||<Yn X|||<|j||jdr&|dd|kr&|dd}||kr&|||<n|||<|j|q,WqWx.|jD]"\}} t| tr<| j||<qs             ?   M [