B ^x_c @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.Zd%Zej dZ d/ej dd0Z d1ej dd0ZejejZejejZejejZejejZdadZd2d3ZejrPejeejZn eeZej d4kre!"d5reej#eeeZd6ej$kreej$d6Zd7d8Z%e&ed9dZ'ej d4krd:d;Z(e(eZe(e'Z'did=d>Z)e)d?Z*e*rx&d@D]Z+dAee+dB<dCee+dD<qWdEdFZ,dGdHZ-dIdJZ.dKdLZ/dMdNZ0djdOdPZ1dQdZ2dRdSZ3dTdUZ4dVdWZ5dXdYZ6dkdZdZ7d[dZ8d\d Z9d]d Z:e/dd?fd^d Z;e/dd?fd_dZdbd Z?dcd Z@dddeZAdfdgZBeCdhkreBdS)lz-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_homentZnt_userZ posix_userZosx_framework_user%d.%dz%d%dcCs"yt|Stk r|SXdSN)rOSError)pathr!/usr/lib64/python3.7/sysconfig.py_safe_realpathdsr r)z\pcbuild\win32z\pcbuild\amd64Z_PYTHON_PROJECT_BASEcCs.x(dD] }tjtj|d|rdSqWdS)N)z Setup.distz Setup.localZModulesTF)osrZisfilejoin)dZfnrrr_is_python_source_dirys r$Z_homecCs0|r,tj|tjtjtdr,tS|S)NZPCbuild)r!rZnormcase startswithr"_PREFIX)r#rrr _fix_pcbuildsr'FcCs|rtrttSttSr) _sys_homer$ _PROJECT_BASE)Z check_homerrris_python_buildsr*T)rrz{srcdir}/Includerz{projectbase}/.rc Csfy |jf|Stk r`y|jftjStk rZ}ztd|dWdd}~XYnXYnXdS)Nz{%s})formatZKeyErrorr!environAttributeError)ZsZ local_varsZvarrrr _subst_varss r.cCs4|}x&|D]\}}||kr$q|||<qWdSr)keysitems)Z target_dictZ other_dictZ target_keyskeyvaluerrr _extend_dicts r3cCsfi}|dkri}t|txDt|D]4\}}tjdkrHtj|}tjt ||||<q*W|S)N)posixr) r3r_INSTALL_SCHEMESr0r!namer expandusernormpathr.)schemevarsZresr1r2rrr _expand_varss   r;cCstjdkrdStjS)Nr4r)r!r6rrrr_get_default_schemes r<cCsztjdd}|r|Sdd}tjdkrBtjdp6d}||dStjdkrptjrp|dd tjd tjdd S|dd S) NZPYTHONUSERBASEcWstjtjj|Sr)r!rr7r")argsrrrjoinuserz_getuserbase..joinuserrZAPPDATAz~ZPythondarwinZLibraryrrz.local)r!r,getr6sysplatformZ _framework version_info)Zenv_baser>baserrr _getuserbases   rFc Cspddl}|d}|d}|d}|dkr2i}i}i}t|dd}|} WdQRXx| D]} | ds`| d kr|q`|| } | r`| d d \} } | } | d d }d |kr| || <q`y t | } Wn$t k r| d d || <Yq`X| || <q`Wt | }d}x t |dkr0xt|D]}||}||}||}|rv|rv||krp|n|} n|r|n|} | dk r| d } d}| |krt|| }n| |krd}nx| tjkrtj| }n`| |kr0|dr |dd|kr d }n$d| |krd}nt|d| }n d || <}|r&|| d}|d| }||krx||7}||7}d |kr|||<n~y t |}Wn"t k r|||<Yn X|||<|||dr&|dd|kr&|dd}||kr&|||<n|||<||q,WqWx.|D]"\}} t| tr<| ||<qs               ?   M L