Viewing File: /opt/alt/python35/lib/python3.5/site-packages/setuptools/__pycache__/msvc.cpython-35.pyc



\@sdZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddlmZej
dkrddl	mZejZnGd	d
d
ZeZeejjfZyddlmZWnek
rYnXdd
ZdddZddZddZdddZGdddZGdddZGdddZGdddZ dS) a@
Improved support for Microsoft Visual C++ compilers.

Known supported compilers:
--------------------------
Microsoft Visual C++ 9.0:
    Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64)
    Microsoft Windows SDK 6.1 (x86, x64, ia64)
    Microsoft Windows SDK 7.0 (x86, x64, ia64)

Microsoft Visual C++ 10.0:
    Microsoft Windows SDK 7.1 (x86, x64, ia64)

Microsoft Visual C++ 14.0:
    Microsoft Visual C++ Build Tools 2015 (x86, x64, arm)
    Microsoft Visual Studio 2017 (x86, x64, arm, arm64)
    Microsoft Visual Studio Build Tools 2017 (x86, x64, arm, arm64)
N)
LegacyVersion)filterfalse)
get_unpatchedWindows)winregc@s(eZdZdZdZdZdZdS)rN)__name__
__module____qualname__
HKEY_USERSHKEY_CURRENT_USERHKEY_LOCAL_MACHINEHKEY_CLASSES_ROOTrr/msvc.pyr(sr)RegcCsd}|d|f}ytj|d}WnStk
ry&|d|f}tj|d}Wntk
r|d}YnXYnX|rtjjjj|d}tjj|r|Stt|S)a+
    Patched "distutils.msvc9compiler.find_vcvarsall" to use the standalone
    compiler build for Python (VCForPython). Fall back to original behavior
    when the standalone compiler is not available.

    Redirect the path of "vcvarsall.bat".

    Known supported compilers
    -------------------------
    Microsoft Visual C++ 9.0:
        Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64)

    Parameters
    ----------
    version: float
        Required Microsoft Visual C++ version.

    Return
    ------
    vcvarsall.bat path: str
    z-Software\%sMicrosoft\DevDiv\VCForPython\%0.1f
installdirzWow6432Node\Nz
vcvarsall.bat)	r	get_valueKeyErrorospathjoinisfilermsvc9_find_vcvarsall)versionZVC_BASEkey
productdir	vcvarsallrrrr?s

rx86cOsy#tt}|||||SWn)tjjk
r=Yntk
rNYnXyt||jSWn>tjjk
r}zt|||WYdd}~XnXdS)a
    Patched "distutils.msvc9compiler.query_vcvarsall" for support extra
    compilers.

    Set environment without use of "vcvarsall.bat".

    Known supported compilers
    -------------------------
    Microsoft Visual C++ 9.0:
        Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64)
        Microsoft Windows SDK 6.1 (x86, x64, ia64)
        Microsoft Windows SDK 7.0 (x86, x64, ia64)

    Microsoft Visual C++ 10.0:
        Microsoft Windows SDK 7.1 (x86, x64, ia64)

    Parameters
    ----------
    ver: float
        Required Microsoft Visual C++ version.
    arch: str
        Target architecture.

    Return
    ------
    environment: dict
    N)	rmsvc9_query_vcvarsall	distutilserrorsDistutilsPlatformError
ValueErrorEnvironmentInfo
return_env_augment_exception)verarchargskwargsZorigexcrrrr js
r cCsytt|SWntjjk
r.YnXyt|ddjSWn;tjjk
r}zt|dWYdd}~XnXdS)a'
    Patched "distutils._msvccompiler._get_vc_env" for support extra
    compilers.

    Set environment without use of "vcvarsall.bat".

    Known supported compilers
    -------------------------
    Microsoft Visual C++ 14.0:
        Microsoft Visual C++ Build Tools 2015 (x86, x64, arm)
        Microsoft Visual Studio 2017 (x86, x64, arm, arm64)
        Microsoft Visual Studio Build Tools 2017 (x86, x64, arm, arm64)

    Parameters
    ----------
    plat_spec: str
        Target architecture.

    Return
    ------
    environment: dict
    
vc_min_verg,@N)rmsvc14_get_vc_envr!r"r#r%r&r')Z	plat_specr,rrrr.s
r.cOs_dtjkrLddl}t|jtdkrL|jjj||Stt	||S)z
    Patched "distutils._msvccompiler.gen_lib_options" for fix
    compatibility between "numpy.distutils" and "distutils._msvccompiler"
    (for Numpy < 1.11.2)
    znumpy.distutilsrNz1.11.2)
sysmodulesZnumpyr__version__r!Z	ccompilerZgen_lib_optionsrmsvc14_gen_lib_options)r*r+Znprrrr2s
r2rcCs|jd}d|jks1d|jkrd}|jt}d}|dkr|jjddkr|d	7}||d
7}q|d7}n=|dkr|d
7}||d7}n|dkr|d7}|f|_dS)zl
    Add details to the exception message to help guide the user
    as to what action will resolve it.
    rrzvisual cz0Microsoft Visual C++ {version:0.1f} is required.z-www.microsoft.com/download/details.aspx?id=%dg"@Zia64rz* Get it with "Microsoft Windows SDK 7.0": iBz% Get it from http://aka.ms/vcpython27g$@z* Get it with "Microsoft Windows SDK 7.1": iW g,@zj Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-toolsN)r*lowerformatlocalsfind)r,rr)messageZtmplZ
msdownloadrrrr's 
$



r'c@seZdZdZejddjZddZe	ddZ
dd	Zd
dZddd
dZ
ddddZdddZdS)PlatformInfoz
    Current and Target Architectures informations.

    Parameters
    ----------
    arch: str
        Target architecture.
    Zprocessor_architecturercCs|jjdd|_dS)Nx64amd64)r4replacer))selfr)rrr__init__szPlatformInfo.__init__cCs!|j|jjdddS)N_r)r)r7)r=rrr
target_cpuszPlatformInfo.target_cpucCs
|jdkS)Nr)r@)r=rrr
target_is_x86szPlatformInfo.target_is_x86cCs
|jdkS)Nr)current_cpu)r=rrrcurrent_is_x86szPlatformInfo.current_is_x86FcCs=|jdkr|rdS|jdkr2|r2dSd|jS)uk
        Current platform specific subfolder.

        Parameters
        ----------
        hidex86: bool
            return '' and not '†' if architecture is x86.
        x64: bool
            return 'd' and not 'md64' if architecture is amd64.

        Return
        ------
        subfolder: str
            '	arget', or '' (see hidex86 parameter)
        rrr;z\x64z\%s)rB)r=hidex86r:rrrcurrent_dir	szPlatformInfo.current_dircCs=|jdkr|rdS|jdkr2|r2dSd|jS)ar
        Target platform specific subfolder.

        Parameters
        ----------
        hidex86: bool
            return '' and not '\x86' if architecture is x86.
        x64: bool
            return '\x64' and not '\amd64' if architecture is amd64.

        Return
        ------
        subfolder: str
            '\current', or '' (see hidex86 parameter)
        rrr;z\x64z\%s)r@)r=rDr:rrr
target_dirszPlatformInfo.target_dircCsB|rdn|j}|j|kr(dS|jjdd|S)ao
        Cross platform specific subfolder.

        Parameters
        ----------
        forcex86: bool
            Use 'x86' as current architecture even if current acritecture is
            not x86.

        Return
        ------
        subfolder: str
            '' if target architecture is current architecture,
            '\current_target' if not.
        rr\z\%s_)rBr@rFr<)r=forcex86currentrrr	cross_dir5szPlatformInfo.cross_dirN)rr	r
__doc__safe_envgetr4rBr>propertyr@rArCrErFrJrrrrr9sr9c@seZdZdZejejejejfZ	ddZ
eddZeddZ
edd	Zed
dZedd
ZeddZeddZeddZeddZdddZddZdS)RegistryInfoz
    Microsoft Visual Studio related registry informations.

    Parameters
    ----------
    platform_info: PlatformInfo
        "PlatformInfo" instance.
    cCs
||_dS)N)pi)r=Z
platform_inforrrr>ZszRegistryInfo.__init__cCsdS)z<
        Microsoft Visual Studio root registry key.
        ZVisualStudior)r=rrrvisualstudio]szRegistryInfo.visualstudiocCstjj|jdS)z;
        Microsoft Visual Studio SxS registry key.
        ZSxS)rrrrQ)r=rrrsxsdszRegistryInfo.sxscCstjj|jdS)z8
        Microsoft Visual C++ VC7 registry key.
        ZVC7)rrrrR)r=rrrvckszRegistryInfo.vccCstjj|jdS)z;
        Microsoft Visual Studio VS7 registry key.
        ZVS7)rrrrR)r=rrrvsrszRegistryInfo.vscCsdS)z?
        Microsoft Visual C++ for Python registry key.
        zDevDiv\VCForPythonr)r=rrr
vc_for_pythonyszRegistryInfo.vc_for_pythoncCsdS)z-
        Microsoft SDK registry key.
        zMicrosoft SDKsr)r=rrr
microsoft_sdkszRegistryInfo.microsoft_sdkcCstjj|jdS)z>
        Microsoft Windows/Platform SDK registry key.
        r)rrrrV)r=rrrwindows_sdkszRegistryInfo.windows_sdkcCstjj|jdS)z<
        Microsoft .NET Framework SDK registry key.
        ZNETFXSDK)rrrrV)r=rrr	netfx_sdkszRegistryInfo.netfx_sdkcCsdS)z<
        Microsoft Windows Kits Roots registry key.
        zWindows Kits\Installed Rootsr)r=rrrwindows_kits_rootsszRegistryInfo.windows_kits_rootsFcCs:|jjs|rdnd}tjjd|d|S)a

        Return key in Microsoft software registry.

        Parameters
        ----------
        key: str
            Registry key path where look.
        x86: str
            Force x86 software registry.

        Return
        ------
        str: value
        rZWow6432NodeZSoftwareZ	Microsoft)rPrCrrr)r=rrZnode64rrr	microsofts!zRegistryInfo.microsoftcCstj}tj}|j}x|jD]}y||||d|}Wnmttfk
r|jjsy"||||dd|}Wqttfk
rw%YqXnw%YnXytj	||dSWq%ttfk
rYq%Xq%WdS)a
        Look for values in registry in Microsoft software registry.

        Parameters
        ----------
        key: str
            Registry key path where look.
        name: str
            Value name to find.

        Return
        ------
        str: value
        rTN)
rKEY_READOpenKeyrZHKEYSOSErrorIOErrorrPrCZQueryValueEx)r=rnamer[Zopenkeymshkeybkeyrrrlookups"			"zRegistryInfo.lookupN)rr	r
rKrrrr
rr]r>rNrQrRrSrTrUrVrWrXrYrZrdrrrrrOLs"rOc@seZdZdZejddZejddZejdeZdddZ	d	d
Z
ddZed
dZ
eddZddZddZeddZeddZeddZeddZeddZedd Zed!d"Zed#d$Zed%d&Zed'd(Zed)d*Zed+d,Zed-d.Zd/d0Zdd1d2ZdS)3
SystemInfoz
    Microsoft Windows and Visual Studio related system inormations.

    Parameters
    ----------
    registry_info: RegistryInfo
        "RegistryInfo" instance.
    vc_ver: float
        Required Microsoft Visual C++ version.
    WinDirrProgramFileszProgramFiles(x86)NcCs1||_|jj|_|p'|j|_dS)N)rirP_find_latest_available_vc_vervc_ver)r=Z
registry_inforjrrrr>s	zSystemInfo.__init__cCsCy|jdSWn*tk
r>d}tjj|YnXdS)Nrz%No Microsoft Visual C++ version foundr3)find_available_vc_vers
IndexErrorr!r"r#)r=errrrrris

z(SystemInfo._find_latest_available_vc_vercCs|jj}|jj|jj|jjf}g}xF|jjD]8}x/|D]'}y%tj|||dtj}Wnt	t
fk
rwMYnXtj|\}}}	xbt|D]T}
y9t
tj||
d}||kr|j|Wqtk
rYqXqWx^t|D]P}
y5t
tj||
}||krZ|j|Wq tk
roYq Xq WqMWq@Wt|S)zC
        Find all available Microsoft Visual C++ versions.
        r)rhrZrSrUrTr]rr\r[r^r_ZQueryInfoKeyrangefloatZ	EnumValueappendr$ZEnumKeysorted)r=raZvckeysZvc_versrbrrcZsubkeysvaluesr?ir(rrrrks2!
%
	
z!SystemInfo.find_available_vc_verscCsKd|j}tjj|j|}|jj|jjd|jpJ|S)z4
        Microsoft Visual Studio directory.
        zMicrosoft Visual Studio %0.1fz%0.1f)rjrrrProgramFilesx86rhrdrT)r=r`defaultrrrVSInstallDir
s
zSystemInfo.VSInstallDircCs|j|jp|j}tjj|jjd|j}|jj	|d}|rqtjj|dn|}|jj	|jj
d|jp|}tjj|sd}tj
j||S)z1
        Microsoft Visual C++ directory.
        z%0.1frZVCz(Microsoft Visual C++ directory not found)rv	_guess_vc_guess_vc_legacyrrrrhrUrjrdrSisdirr!r"r#)r=guess_vcZreg_pathZ	python_vcZ
default_vcrmsgrrrVCInstallDirs"!(zSystemInfo.VCInstallDirc
Cs}|jdkrdSd}tjj|j|}y*tj|d}tjj||SWntttfk
rxYnXdS)z*
        Locate Visual C for 2017
        g,@Nz
VC\Tools\MSVCrr3)	rjrrrrvlistdirr^r_rl)r=rurzZvc_exact_verrrrrw0szSystemInfo._guess_vccCs#d|j}tjj|j|S)z<
        Locate Visual C for versions prior to 2017
        z Microsoft Visual Studio %0.1f\VC)rjrrrrt)r=rurrrrx@s
zSystemInfo._guess_vc_legacycCsc|jdkrdS|jdkr&dS|jdkr9dS|jdkrLdS|jdkr_dSdS)zN
        Microsoft Windows SDK versions for specified MSVC++ version.
        g"@7.06.16.0ag$@7.17.0ag&@8.08.0ag(@8.18.1ag,@10.0N)r~rr)rr)rr)rr)rr)rj)r=rrrWindowsSdkVersionGszSystemInfo.WindowsSdkVersioncCs|jtjj|jdS)z4
        Microsoft Windows SDK last version
        lib)_use_last_dir_namerrr
WindowsSdkDir)r=rrrWindowsSdkLastVersionWsz SystemInfo.WindowsSdkLastVersioncCsd}xL|jD]A}tjj|jjd|}|jj|d}|rPqW|sotjj|rtjj|jjd|j	}|jj|d}|rtjj|d}|stjj|rBxd|jD]Y}|d|j
d}d	|}tjj|j|}tjj|r|}qW|s\tjj|rxK|jD]@}d
|}tjj|j|}tjj|rf|}qfW|stjj|jd}|S)z2
        Microsoft Windows SDK directory.
        rzv%sinstallationfolderz%0.1frZWinSDKN.zMicrosoft SDKs\Windows Kits\%szMicrosoft SDKs\Windows\v%sZPlatformSDK)
rrrrrhrWrdryrUrjrfindrgr|)r=sdkdirr(locrZinstall_baseZintverdrrrr_s6"



zSystemInfo.WindowsSdkDirc	Cs2|jdkrd}d}n<d}|jdkr9dnd}|jjddd	|}d
||jddf}g}|jd
krx6|jD]+}|tjj|jj	||g7}qWx:|j
D]/}|tjj|jjd||g7}qWx*|D]"}|jj|d}|rPqW|S)z=
        Microsoft Windows SDK executable directory.
        g&@#r(g(@TFr:rDzWinSDK-NetFx%dTools%srG-g,@zv%sAr)
rjrPrEr<NetFxSdkVersionrrrrhrXrrWrd)	r=Znetfxverr)rDZfxZregpathsr(rZexecpathrrrWindowsSDKExecutablePaths$	)-
z#SystemInfo.WindowsSDKExecutablePathcCsAd|j}tjj|jj|}|jj|dp@dS)z0
        Microsoft Visual F# directory.
        z%0.1f\Setup\F#rr)rjrrrrhrQrd)r=rrrrFSharpInstallDirs
zSystemInfo.FSharpInstallDircCs_|jdkrd}nf}x4|D],}|jj|jjd|}|r%Pq%W|p^dS)z8
        Microsoft Universal CRT SDK directory.
        g,@1081z
kitsroot%sr)rr)rjrhrdrY)r=Zversr(rrrrUniversalCRTSdkDirs	

zSystemInfo.UniversalCRTSdkDircCs|jtjj|jdS)z@
        Microsoft Universal C Runtime SDK last version
        r)rrrrr)r=rrrUniversalCRTSdkLastVersionsz%SystemInfo.UniversalCRTSdkLastVersioncCs|jdkrdSfSdS)z8
        Microsoft .NET Framework SDK versions.
        g,@4.6.14.6N)rr)rj)r=rrrrszSystemInfo.NetFxSdkVersioncCsUxH|jD]=}tjj|jj|}|jj|d}|r
Pq
W|pTdS)z9
        Microsoft .NET Framework SDK directory.
        Zkitsinstallationfolderr)rrrrrhrXrd)r=r(rrrrrNetFxSdkDirszSystemInfo.NetFxSdkDircCs7tjj|jd}|jj|jjdp6|S)z;
        Microsoft .NET Framework 32bit directory.
        zMicrosoft.NET\FrameworkZframeworkdir32)rrrrfrhrdrS)r=guess_fwrrrFrameworkDir32szSystemInfo.FrameworkDir32cCs7tjj|jd}|jj|jjdp6|S)z;
        Microsoft .NET Framework 64bit directory.
        zMicrosoft.NET\Framework64Zframeworkdir64)rrrrfrhrdrS)r=rrrrFrameworkDir64szSystemInfo.FrameworkDir64cCs
|jdS)z:
        Microsoft .NET Framework 32bit versions.
         )_find_dot_net_versions)r=rrrFrameworkVersion32szSystemInfo.FrameworkVersion32cCs
|jdS)z:
        Microsoft .NET Framework 64bit versions.
        @)r)r=rrrFrameworkVersion64szSystemInfo.FrameworkVersion64cCs|jj|jjd|}t|d|}|pM|j|dpMd}|jdkrn|df}nU|jdkr|jdd	d
krdn|df}n|jd
krd}|jdkrd}|S)z
        Find Microsoft .NET Framework versions.

        Parameters
        ----------
        bits: int
            Platform number of bits: 32 or 64.
        zframeworkver%dzFrameworkDir%dvrg(@zv4.0g$@NZv4z
v4.0.30319v3.5g"@
v2.0.50727g @v3.0)rr)rr)rhrdrSgetattrrrjr4)r=bitsZreg_verZdot_net_dirr(Zframeworkverrrrrs
%z!SystemInfo._find_dot_net_versionscs>fddttjD}t|dp=dS)z
        Return name of the last dir in path or '' if no dir found.

        Parameters
        ----------
        path: str
            Use dirs in this path
        prefix: str
            Use only dirs startings by this prefix
        c3sE|];}tjjtjj|r|jr|VqdS)N)rrryr
startswith).0Zdir_name)rprefixrr	<genexpr>)s!z0SystemInfo._use_last_dir_name.<locals>.<genexpr>Nr)reversedrr}next)r=rrZ
matching_dirsr)rrrrszSystemInfo._use_last_dir_name) rr	r
rKrLrMrfrgrtr>rirkrNrvr|rwrxrrrrrrrrrrrrrrrrrrrres4
&	rec@seZdZdZddddZeddZedd	Zed
dZedd
Z	eddZ
eddZeddZeddZ
eddZeddZddZeddZeddZed d!Zed"d#Zed$d%Zed&d'Zed(d)Zed*d+Zed,d-Zed.d/Zed0d1Zed2d3Zed4d5Zd6d7d8Zd9d:Zdd;d<Z dS)=r%aY
    Return environment variables for specified Microsoft Visual C++ version
    and platform : Lib, Include, Path and libpath.

    This function is compatible with Microsoft Visual C++ 9.0 to 14.0.

    Script created by analysing Microsoft environment configuration files like
    "vcvars[...].bat", "SetEnv.Cmd", "vcbuildtools.bat", ...

    Parameters
    ----------
    arch: str
        Target architecture.
    vc_ver: float
        Required Microsoft Visual C++ version. If not set, autodetect the last
        version.
    vc_min_ver: float
        Minimum Microsoft Visual C++ version.
    NrcCsat||_t|j|_t|j||_|j|kr]d}tjj	|dS)Nz.No suitable Microsoft Visual C++ version found)
r9rPrOrhresirjr!r"r#)r=r)rjr-rmrrrr>IszEnvironmentInfo.__init__cCs
|jjS)z/
        Microsoft Visual C++ version.
        )rrj)r=rrrrjRszEnvironmentInfo.vc_vercsxddg}jdkrajjdddd}|dg7}|dg7}|d	|g7}fd
d|DS)z/
        Microsoft Visual Studio Tools
        zCommon7\IDEz
Common7\Toolsg,@rDTr:z1Common7\IDE\CommonExtensions\Microsoft\TestWindowzTeam Tools\Performance ToolszTeam Tools\Performance Tools%scs+g|]!}tjjjj|qSr)rrrrrv)rr)r=rr
<listcomp>fs	z+EnvironmentInfo.VSTools.<locals>.<listcomp>)rjrPrE)r=pathsarch_subdirr)r=rVSToolsYs

zEnvironmentInfo.VSToolscCs4tjj|jjdtjj|jjdgS)zL
        Microsoft Visual C++ & Microsoft Foundation Class Includes
        ZIncludezATLMFC\Include)rrrrr|)r=rrr
VCIncludeshszEnvironmentInfo.VCIncludescsjdkr'jjdd}njjdd}d|d|g}jdkrp|d|g7}fd	d
|DS)zM
        Microsoft Visual C++ & Microsoft Foundation Class Libraries
        g.@r:TrDzLib%szATLMFC\Lib%sg,@zLib\store%scs+g|]!}tjjjj|qSr)rrrrr|)rr)r=rrr~s	z/EnvironmentInfo.VCLibraries.<locals>.<listcomp>)rjrPrF)r=rrr)r=rVCLibrariespszEnvironmentInfo.VCLibrariescCs/|jdkrgStjj|jjdgS)zA
        Microsoft Visual C++ store references Libraries
        g,@zLib\store\references)rjrrrrr|)r=rrrVCStoreRefsszEnvironmentInfo.VCStoreRefscCs|j}tjj|jdg}|jdkr9dnd}|jj|}|rz|tjj|jd|g7}|jdkrd|jjdd}|tjj|j|g7}n|jdkrm|jj	rd	nd
}|tjj|j||jj
ddg7}|jj|jjkr|tjj|j||jjddg7}n|tjj|jdg7}|S)
z,
        Microsoft Visual C++ Tools
        Z
VCPackagesg$@TFzBin%sg,@rDg.@z
bin\HostX86%sz
bin\HostX64%sr:Bin)
rrrrr|rjrPrJrErCrFrBr@)r=rtoolsrHrrZhost_dirrrrVCToolss&	#"&)zEnvironmentInfo.VCToolscCs|jdkrJ|jjdddd}tjj|jjd|gS|jjdd}tjj|jjd}|j}tjj|d||fgSdS)	z1
        Microsoft Windows SDK Libraries
        g$@rDTr:zLib%srz%sum%sN)	rjrPrFrrrrr_sdk_subdir)r=rrZlibverrrrOSLibrariess 	zEnvironmentInfo.OSLibrariescCstjj|jjd}|jdkrC|tjj|dgS|jdkr^|j}nd}tjj|d|tjj|d|tjj|d|gSd	S)
z/
        Microsoft Windows SDK Include
        includeg$@Zglg,@rz%ssharedz%sumz%swinrtN)rrrrrrjr)r=rsdkverrrr
OSIncludesszEnvironmentInfo.OSIncludescCs
tjj|jjd}g}|jdkr=||j7}|jdkrh|tjj|dg7}|jdkr	||tjj|jjdtjj|ddtjj|d	dtjj|d
dtjj|jjddd
|jdddg7}|S)z7
        Microsoft Windows SDK Libraries Paths
        Z
Referencesg"@g&@zCommonConfiguration\Neutralg,@Z
UnionMetadataz'Windows.Foundation.UniversalApiContractz1.0.0.0z%Windows.Foundation.FoundationContractz,Windows.Networking.Connectivity.WwanContractZ
ExtensionSDKszMicrosoft.VCLibsz%0.1fZCommonConfigurationZneutral)rrrrrrjr)r=reflibpathrrr	OSLibpaths>
					

zEnvironmentInfo.OSLibpathcCst|jS)z-
        Microsoft Windows SDK Tools
        )list
_sdk_tools)r=rrrSdkToolsszEnvironmentInfo.SdkToolsccs|jdkrD|jdkr$dnd}tjj|jj|V|jjs|jjdd}d|}tjj|jj|V|jdks|jdkr|jj	rd	}n|jjd
ddd}d|}tjj|jj|Vni|jdkrmtjj|jjd}|jjdd}|jj
}tjj|d||fV|jjr|jjVd
S)z=
        Microsoft Windows SDK Tools paths generator
        g.@g&@rzBin\x86r:TzBin%sg$@rrDzBin\NETFX 4.0 Tools%sz%s%sN)rjrrrrrrPrCrErArr)r=Zbin_dirrrrrrrrs(
	
zEnvironmentInfo._sdk_toolscCs|jj}|rd|SdS)z6
        Microsoft Windows SDK version subdir
        z%s\r)rr)r=ucrtverrrrrszEnvironmentInfo._sdk_subdircCs/|jdkrgStjj|jjdgS)z-
        Microsoft Windows SDK Setup
        g"@ZSetup)rjrrrrr)r=rrrSdkSetup%szEnvironmentInfo.SdkSetupcs|j}|j|jdkrDd}|jo>|j}n6|jpY|j}|jdkpw|jdk}g}|r|fddjD7}|r|fddjD7}|S)z0
        Microsoft .NET Framework Tools
        g$@Tr;cs(g|]}tjjj|qSr)rrrr)rr()rrrr@s	z+EnvironmentInfo.FxTools.<locals>.<listcomp>cs(g|]}tjjj|qSr)rrrr)rr()rrrrCs	)	rPrrjrArCrBr@rr)r=rPZ	include32Z	include64rr)rrFxTools/s		zEnvironmentInfo.FxToolscCsU|jdks|jjr gS|jjdd}tjj|jjd|gS)z8
        Microsoft .Net Framework SDK Libraries
        g,@r:Tzlib\um%s)rjrrrPrFrrr)r=rrrrNetFxSDKLibrariesGsz!EnvironmentInfo.NetFxSDKLibrariescCs<|jdks|jjr gStjj|jjdgS)z7
        Microsoft .Net Framework SDK Includes
        g,@z
include\um)rjrrrrr)r=rrrNetFxSDKIncludesRsz EnvironmentInfo.NetFxSDKIncludescCstjj|jjdgS)z>
        Microsoft Visual Studio Team System Database
        z
VSTSDB\Deploy)rrrrrv)r=rrrVsTDb\szEnvironmentInfo.VsTDbcCs|jdkrgS|jdkrF|jj}|jjdd}n|jj}d}d|j|f}tjj||g}|jdkr|tjj||dg7}|S)z(
        Microsoft Build Engine
        g(@g.@rDTrzMSBuild\%0.1f\bin%sZRoslyn)	rjrrtrPrErvrrr)r=	base_pathrrZbuildrrrMSBuildcszEnvironmentInfo.MSBuildcCs/|jdkrgStjj|jjdgS)z.
        Microsoft HTML Help Workshop
        g&@zHTML Help Workshop)rjrrrrrt)r=rrrHTMLHelpWorkshopzsz EnvironmentInfo.HTMLHelpWorkshopcCsl|jdkrgS|jjdd}tjj|jjd}|j}tjj|d||fgS)z=
        Microsoft Universal C Runtime SDK Libraries
        g,@r:Trz%sucrt%s)	rjrPrFrrrrr_ucrt_subdir)r=rrrrrr
UCRTLibrariess	zEnvironmentInfo.UCRTLibrariescCsK|jdkrgStjj|jjd}tjj|d|jgS)z;
        Microsoft Universal C Runtime SDK Include
        g,@rz%sucrt)rjrrrrrr)r=rrrrUCRTIncludesszEnvironmentInfo.UCRTIncludescCs|jj}|rd|SdS)zB
        Microsoft Universal C Runtime SDK version subdir
        z%s\r)rr)r=rrrrrszEnvironmentInfo._ucrt_subdircCs,|jdkr"|jdkr"gS|jjS)z%
        Microsoft Visual F#
        g&@g(@)rjrr)r=rrrFSharpszEnvironmentInfo.FSharpcCs|jjdd}|jdkr9|jj}d}n|jjjdd}d}|jdkrldn|j}|||j|f}tjj||S)	zA
        Microsoft Visual C++ runtime redistribuable dll
        r:Tz-redist%s\Microsoft.VC%d0.CRT\vcruntime%d0.dllz\Toolsz\Redistz.onecore%s\Microsoft.VC%d0.CRT\vcruntime%d0.dllg,@)	rPrFrjrr|r<rrr)r=rZredist_pathZ	vcruntimeZdll_verrrrVCRuntimeRedists	zEnvironmentInfo.VCRuntimeRedistTcCstd|jd|j|j|j|jg|d|jd|j|j|j|j	|j
g|d|jd|j|j|j|jg|d|jd|j
|j|j|j|j|j|j|j|jg	|}|jdkrtjj|jr|j|d<|S)z
        Return environment dict.

        Parameters
        ----------
        exists: bool
            It True, only return existing paths.
        rrrrZpy_vcruntime_redist)dict_build_pathsrrrrrrrrrrrrrrrrrrrrjrrrr)r=existsenvrrrr&sD												$
zEnvironmentInfo.return_envc
Cstjj|}tj|djtj}tj||}|rctt	tj
j|n|}|sd|j}t
jj||j|}	tjj|	S)a
        Given an environment variable name and specified paths,
        return a pathsep-separated string of paths containing
        unique, extant, directories from those paths and from
        the environment variable. Raise an error if no paths
        are resolved.
        rz %s environment variable is empty)	itertoolschain
from_iterablerLrMsplitrpathseprfilterrryupperr!r"r#_unique_everseenr)
r=r`Zspec_path_listsrZ
spec_pathsZ	env_pathsrZextant_pathsr{Zunique_pathsrrrrs	'zEnvironmentInfo._build_pathsccst}|j}|dkrMxdt|j|D]}|||Vq1Wn8x5|D]-}||}||krT|||VqTWdS)z
        List unique elements, preserving order.
        Remember all elements ever seen.

        _unique_everseen('AAAABBBCCDAABBB') --> A B C D

        _unique_everseen('ABBCcAD', str.lower) --> A B C D
        N)setaddr__contains__)r=iterablerseenZseen_addelementkrrrrs			


z EnvironmentInfo._unique_everseen)!rr	r
rKr>rNrjrrrrrrrrrrrrrrrrrrrrrrrr&rrrrrrr%1s:		 -




-r%)!rKrr/platformrZdistutils.errorsr!Z&pkg_resources.extern.packaging.versionrZsetuptools.extern.six.movesrZmonkeyrsystemrenvironrLrImportErrorr"r#Z_msvc9_suppress_errorsZdistutils.msvc9compilerrrr r.r2r'r9rOrer%rrrr<module>s:	
+/&
%[a
Back to Directory File Manager