abc @s_dZddlZddlZddlZddlZddlmZmZyddlZWne k r{ddl ZnXdddddd d d d d dg Z dZ ej rejje ej Zne ejZejdkr(dedjkr(e ejjeeZnejdkrndedjkrne ejjeeeZnejdkrdedjkre ejjeeeZndZeZeadZejZejdZdZejj dZ!ejd Z"e!de!dZ#ejj$ej%Z&ejj$ej'Z(da*dZ+dZ,dZ-d Z.d!Z/d"Z0d#Z1dd$Z2d%Z3d&Z4d'Z5dd(Z6d)Z7d*Z8d+Z9e0de:d,Z;e0de:d-Z<d.Z=d/Z>d0Z?d1Z@d2ZAd3ZBeCd4kr[eBndS(5s-Access to Python's configuration information.iN(tpardirtrealpathtget_config_h_filenametget_config_vartget_config_varstget_makefile_filenametget_pathtget_path_namest get_pathst get_platformtget_python_versiontget_scheme_namestparse_config_hcCs'yt|SWntk r"|SXdS(N(RtOSError(tpath((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyt_safe_realpath"s tnttpcbuildis\pc\vis\pcbuild\amd64icCs=x6dD].}tjjtjjtd|rtSqWtS(Ns Setup.dists Setup.localtModules(s Setup.dists Setup.local(tosRtisfiletjoint _PROJECT_BASEtTruetFalse(tfn((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pytis_python_build:s $cCstsddlm}tjddd}||}|jd}|j}tj|WdQXt rx7d D],}tj |d d tj |d d qvWnt andS(Ni(tfindert.iis sysconfig.cfgt posix_prefixt posix_hometincludes{srcdir}/Includet platincludes{projectbase}/.(RR( t _cfg_readt resourcesRt__name__trsplittfindt as_streamt_SCHEMEStreadfpt _PYTHON_BUILDtsetR(Rtbackport_packaget_findert_cfgfiletstscheme((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyt_ensure_cfg_readDs  s \{([^{]*?)\}cs-t|jdr(|jd}n t}|j}xb|D]Z}|dkr\qDnx?|D]7\}}|j||rqcn|j|||qcWqDW|jdxw|jD]i}t|j|fd}x<|j|D]+\}}|j||t j ||qWqWdS(Ntglobalscs0|jd}|kr#|S|jdS(Nii(tgroup(tmatchobjtname(t variables(sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyt _replaceros ( R0t has_sectiontitemsttupletsectionst has_optionR*tremove_sectiontdictt _VAR_REPLtsub(tconfigR1R:tsectiontoptiontvalueR6((R5sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyt_expand_globalsYs$     iiicsfd}tj||S(sIn the string `path`, replace tokens like {some.thing} with the corresponding value from the map `local_vars`. If there is no corresponding value, leave the token unchanged. csJ|jd}|kr#|S|tjkr=tj|S|jdS(Nii(R2Rtenviron(R3R4(t local_vars(sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyR6s   (R>R?(RRFR6((RFsK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyt _subst_varsscCsI|j}x6|jD](\}}||kr7qn|||R?(RCRRR6((RRsK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyt format_valuescCstjdkrdStjS(NRNR(RR4(((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyt_get_default_schemescCstjjdd}d}tjdkr_tjjdpBd}|rO|S||dSntjdkrtd}|r|r|S|dd |d tjd Sqn|r|S|dd SdS( NtPYTHONUSERBASEcWstjjtjj|S(N(RRRPR(targs((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pytjoinusersRtAPPDATAt~tPythontdarwintPYTHONFRAMEWORKtLibrarys%d.%dis.local( RREtgetROR4tsystplatformRt version_info(tenv_baseRYtbaset framework((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyt _getuserbases"  cCstjd}tjd}tjd}|dkrBi}ni}i}tj|dddd}|j}WdQXx|D]} | jd s| jd krqn|j| } | r| j d d \} } | j} | j d d } d| kr| || dttjf}nd}tjjt d|dS(s Return the path of the Makefile.tMakefiletabiflagss config-%s%sR@tstdlib( R)RRRRthasattrRat_PY_VERSION_SHORTRR(tconfig_dir_name((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyRMs cCst}yt||WnLtk rh}d|}t|drY|d|j}nt|nXt}y&t|}t||WdQXWnLtk r}d|}t|dr|d|j}nt|nXtr|d|dkrd4}qI|d?krd5}qIt d6|fqL|d.krtj!d@krId0}qIqL|dAkrLtj!dBkr@d3}qId/}qLqOnd:|||fS(CsReturn a string that identifies the current platform. This is used mainly to distinguish platform-specific build directories and platform-specific built distributions. Typically includes the OS name and version and the architecture (as supplied by 'os.uname()'), although the exact information included depends on the OS; eg. for IRIX the architecture isn't particularly important (IRIX only runs on SGI hardware), but for Linux the kernel version isn't particularly important. Examples of returned values: linux-i586 linux-alpha (?) solaris-2.6-sun4u irix-5.3 irix64-6.2 Windows will return one of: win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc) win-ia64 (64bit Windows on Itanium) win32 (all others - specifically, sys.platform is returned) For other non-POSIX platforms, currently just returns 'sys.platform'. Rs bit (it)tamd64s win-amd64titaniumswin-ia64RNRt/RlRt_t-itlinuxs%s-%stsunosit5tsolariss%d.%siiitirixtaixs%s-%s.%sitcygwins[\d.]+R]tMACOSX_DEPLOYMENT_TARGETs0/System/Library/CoreServices/SystemVersion.plists=ProductUserVisibleVersion\s*(.*?)NRitmacosxs10.4.s-archRntfats -arch\s+(\S+)ti386tppctx86_64tinteltfat3tppc64tfat64t universals%Don't know machine value for archs=%ri tPowerPCtPower_Macintoshs%s-%s-%s(RR(RR(RRR(RR(RRRRI(RRI("RR4RaRR%RbR~tlowerRRRzR{RrRsRyR2RR`RRuRRtreadtcloseRORRRxtfindallR9RR*R|tmaxsize(RtitjtlooktosnamethosttreleaseRtmachinetrel_reRtcfgvarstmacvert macreleaseRtcflagstarchs((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyR [s    (     + !               cCstS(N(R(((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyR scCsZxStt|jD]9\}\}}|dkrCd|GHnd||fGHqWdS(Nis%s: s %s = "%s"(t enumerateRR8(ttitletdatatindexRLRC((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyt _print_dicts+  cCsRdtGHdtGHdtGHdGHtdtdGHtdtdS( s*Display all information sysconfig detains.sPlatform: "%s"sPython version: "%s"s!Current installation scheme: "%s"tPathst VariablesN(((R R RVRRR(((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyt_mains   t__main__(Dt__doc__RtRRrRatos.pathRRt configparsert ImportErrort ConfigParsert__all__RRRRRRR4RRRR)RR!R0tRawConfigParserR'RsR>RDRRRRRRQRRRRRORt _USER_BASERGRMRTRURVRgRRRRR RR RRRRRRR R RRR#(((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyts        %%!%!     #      v