403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.109
Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64
User : SERVERWEB ( 0)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  C:/cygwin64/lib/python3.9/site-packages/setuptools/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.9/site-packages/setuptools/__pycache__/msvc.cpython-39.pyc
a

��et��@sLUdZddlZddlmZmZddlmZmZmZm	Z	ddl
mZddlZddl
Z
ddlZddl
Z
ddlZddlmZmZddlmZes�e
��dkr�ddlZdd	lmZn$Gd
d�d�Ze�Zeeefed<d
d�Zdd�Zddddd�Zdd�Zdd�Z dd�Z!d'dd�Z"Gdd �d �Z#Gd!d"�d"�Z$Gd#d$�d$�Z%Gd%d&�d&�Z&dS)(a�
Improved support for Microsoft Visual C++ compilers.

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

This may also support compilers shipped with compatible Visual Studio versions.
�N)�listdir�pathsep)�join�isfile�isdir�dirname)�CalledProcessError)�Dict�
TYPE_CHECKING)�unique_everseen�Windows)�environc@seZdZdZdZdZdZdS)�winregN)�__name__�
__module__�__qualname__�
HKEY_USERS�HKEY_CURRENT_USER�HKEY_LOCAL_MACHINE�HKEY_CLASSES_ROOT�rr�3/usr/lib/python3.9/site-packages/setuptools/msvc.pyr!srr
cCszt�tjddtjtjB�}Wnty2YdS0d}d}|��t��D]�}zt�||�\}}}Wnty|Yq�Yn0|rJ|tj	krJt
|�rJztt|��}Wnt
tfy�YqJYn0|dkrJ||krJ||}}qJWd�n1s�0Y||fS)�0Python 3.8 "distutils/_msvccompiler.py" backportz'Software\Microsoft\VisualStudio\SxS\VC7r�NNN�)r�OpenKeyr�KEY_READZKEY_WOW64_32KEY�OSError�	itertools�count�	EnumValueZREG_SZr�int�float�
ValueError�	TypeError)�key�best_version�best_dir�i�vZvc_dirZvt�versionrrr�_msvc14_find_vc2015*s2
�
*r+c
Cs�t�d�pt�d�}|sdSd}|D]�}t�ttt��tt�t	|ddd�dd	d
|ddd
dg	�j
ddd���}t	|ddd�}t|�r�d|fWd�SWd�q$1s�0Yq$dS)a�Python 3.8 "distutils/_msvccompiler.py" backport

    Returns "15, path" based on the result of invoking vswhere.exe
    If no install is found, returns "None, None"

    The version is returned to avoid unnecessarily changing the function
    result. It may be ignored when the path is not None.

    If vswhere.exe is not available, by definition, VS 2017 is not
    installed.
    �ProgramFiles(x86)�ProgramFilesr)z1Microsoft.VisualStudio.Component.VC.Tools.x86.x64z)Microsoft.VisualStudio.Workload.WDExpresszMicrosoft Visual StudioZ	Installerzvswhere.exez-latestz-prereleasez	-requiresz	-property�installationPathz	-products�*�mbcs�strict)�encoding�errors�VCZ	AuxiliaryZBuild�N)
r
�get�
contextlib�suppressrr�UnicodeDecodeError�
subprocess�check_outputr�decode�stripr)�rootZsuitable_componentsZ	component�pathrrr�_msvc14_find_vc2017Hs0���:r@�x86�x64ZarmZarm64)rAZ	x86_amd64Zx86_armZ	x86_arm64c	
Cs�t�\}}d}|tvr t|}nd|vr,dnd}|r�t|ddddd|d	d
�	}zddl}|j|dd
�d}Wntttfy�d}Yn0|s�t�\}}|r�t|d|dd
�}|s�dSt|d�}t|�s�dS|r�t|�s�d}||fS)rN�amd64rBrAz..�redistZMSVCz**zMicrosoft.VC14*.CRTzvcruntime140.dllrT)�	recursive���zMicrosoft.VC140.CRTrz
vcvarsall.bat)	r@�PLAT_SPEC_TO_RUNTIMEr�glob�ImportErrorr�LookupErrorr+r)	�	plat_spec�_r'�	vcruntimeZvcruntime_platZvcredistrHr&�	vcvarsallrrr�_msvc14_find_vcvarsallsP

�

�
rOc
Cs�dtvrdd�t��D�St|�\}}|s6tj�d��z&tjd�||�tj	d�j
ddd	�}Wn<tjy�}z"tj�d
�|j��|�WYd}~n
d}~00dd�d
d�|�
�D�D�}|r�||d<|S)rZDISTUTILS_USE_SDKcSsi|]\}}|��|�qSr��lower)�.0r%�valuerrr�
<dictcomp>��z&_msvc14_get_vc_env.<locals>.<dictcomp>zUnable to find vcvarsall.batzcmd /u /c "{}" {} && set)�stderrzutf-16le�replace)r3zError executing {}NcSs$i|]\}}}|r|r|��|�qSrrP)rRr%rLrSrrrrT�s�css|]}|�d�VqdS)�=N)�	partition)rR�linerrr�	<genexpr>�rUz%_msvc14_get_vc_env.<locals>.<genexpr>�py_vcruntime_redist)r
�itemsrO�	distutilsr3�DistutilsPlatformErrorr:r;�formatZSTDOUTr<r�cmd�
splitlines)rKrNrM�out�exc�envrrr�_msvc14_get_vc_env�s0
��

���rfc
CsDz
t|�WStjjy>}zt|d��WYd}~n
d}~00dS)a*
    Patched "distutils._msvccompiler._get_vc_env" for support extra
    Microsoft Visual C++ 14.X compilers.

    Set environment without use of "vcvarsall.bat".

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

    Return
    ------
    dict
        environment
    �,@N)rfr^r3r_�_augment_exception)rKrdrrr�msvc14_get_vc_env�s


ri�cCs�|jd}d|��vs"d|��vr�d}|jfit���}d}|dkrj|���d�dkr`|d	7}q�|d
7}n.|dkr�|d7}||d
7}n|dkr�|d7}|f|_dS)zl
    Add details to the exception message to help guide the user
    as to what action will resolve it.
    rrNzvisual cz;Microsoft Visual C++ {version:0.1f} or greater is required.z-www.microsoft.com/download/details.aspx?id=%d�"@Zia64rFz( Get it with "Microsoft Windows SDK 7.0"z% Get it from http://aka.ms/vcpython27�$@z* Get it with "Microsoft Windows SDK 7.1": iW rgzd Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/N)�argsrQr`�locals�find)rdr*�arch�messageZtmplZ
msdownloadrrrrh�s"


�rhc@sbeZdZdZe�dd���Zdd�Ze	dd��Z
dd	�Zd
d�Zdd
d�Z
ddd�Zddd�ZdS)�PlatformInfoz�
    Current and Target Architectures information.

    Parameters
    ----------
    arch: str
        Target architecture.
    Zprocessor_architecturerjcCs|���dd�|_dS)NrBrC)rQrWrp)�selfrprrr�__init__szPlatformInfo.__init__cCs|j|j�d�dd�S)zs
        Return Target CPU architecture.

        Return
        ------
        str
            Target CPU
        rL�N)rpro�rsrrr�
target_cpu"s
zPlatformInfo.target_cpucCs
|jdkS)z�
        Return True if target CPU is x86 32 bits..

        Return
        ------
        bool
            CPU is x86 32 bits
        rA�rwrvrrr�
target_is_x86.s	zPlatformInfo.target_is_x86cCs
|jdkS)z�
        Return True if current CPU is x86 32 bits..

        Return
        ------
        bool
            CPU is x86 32 bits
        rA��current_cpurvrrr�current_is_x869s	zPlatformInfo.current_is_x86FcCs.|jdkr|rdS|jdkr$|r$dSd|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
        ------
        str
            subfolder: '	arget', or '' (see hidex86 parameter)
        rArjrC�\x64�\%srz�rs�hidex86rBrrr�current_dirDs�����zPlatformInfo.current_dircCs.|jdkr|rdS|jdkr$|r$dSd|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
        ------
        str
            subfolder: '\current', or '' (see hidex86 parameter)
        rArjrCr}r~rxrrrr�
target_dir\s�����zPlatformInfo.target_dircCs0|rdn|j}|j|krdS|���dd|�S)ap
        Cross platform specific subfolder.

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

        Return
        ------
        str
            subfolder: '' if target architecture is current architecture,
            '\current_target' if not.
        rArj�\z\%s_)r{rwr�rW)rs�forcex86�currentrrr�	cross_dirts
��zPlatformInfo.cross_dirN)FF)FF)F)rrr�__doc__r
r6rQr{rt�propertyrwryr|r�r�r�rrrrrrs	


rrc@s�eZdZdZejejejejfZ	dd�Z
edd��Zedd��Z
edd	��Zed
d��Zedd
��Zedd��Zedd��Zedd��Zedd��Zddd�Zdd�ZdS)�RegistryInfoz�
    Microsoft Visual Studio related registry information.

    Parameters
    ----------
    platform_info: PlatformInfo
        "PlatformInfo" instance.
    cCs
||_dS�N)�pi)rsZ
platform_inforrrrt�szRegistryInfo.__init__cCsdS)z�
        Microsoft Visual Studio root registry key.

        Return
        ------
        str
            Registry key
        ZVisualStudiorrvrrr�visualstudio�s
zRegistryInfo.visualstudiocCst|jd�S)z
        Microsoft Visual Studio SxS registry key.

        Return
        ------
        str
            Registry key
        ZSxS)rr�rvrrr�sxs�s
zRegistryInfo.sxscCst|jd�S)z|
        Microsoft Visual C++ VC7 registry key.

        Return
        ------
        str
            Registry key
        ZVC7�rr�rvrrr�vc�s
zRegistryInfo.vccCst|jd�S)z
        Microsoft Visual Studio VS7 registry key.

        Return
        ------
        str
            Registry key
        ZVS7r�rvrrr�vs�s
zRegistryInfo.vscCsdS)z�
        Microsoft Visual C++ for Python registry key.

        Return
        ------
        str
            Registry key
        zDevDiv\VCForPythonrrvrrr�
vc_for_python�s
zRegistryInfo.vc_for_pythoncCsdS)zq
        Microsoft SDK registry key.

        Return
        ------
        str
            Registry key
        zMicrosoft SDKsrrvrrr�
microsoft_sdk�s
zRegistryInfo.microsoft_sdkcCst|jd�S)z�
        Microsoft Windows/Platform SDK registry key.

        Return
        ------
        str
            Registry key
        r�rr�rvrrr�windows_sdk�s
zRegistryInfo.windows_sdkcCst|jd�S)z�
        Microsoft .NET Framework SDK registry key.

        Return
        ------
        str
            Registry key
        ZNETFXSDKr�rvrrr�	netfx_sdk�s
zRegistryInfo.netfx_sdkcCsdS)z�
        Microsoft Windows Kits Roots registry key.

        Return
        ------
        str
            Registry key
        zWindows Kits\Installed Rootsrrvrrr�windows_kits_rootss
zRegistryInfo.windows_kits_rootsFcCs$|j��s|rdnd}td|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
            Registry key
        rjZWow6432NodeZSoftwareZ	Microsoft)r�r|r)rsr%rAZnode64rrr�	microsoftszRegistryInfo.microsoftc	Cs�tj}tj}tj}|j}|jD]�}d}z||||�d|�}WnTty�|j��s�z||||d�d|�}Wq�ty�YYqYq�0nYqYn0zHz$t�	||�dWW|r�||�Sty�Yn0W|r�||�q|r�||�0qdS)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
        NrT)
rrrZCloseKeyr��HKEYSrr�r|ZQueryValueEx)	rsr%�nameZkey_readZopenkeyZclosekey�ms�hkey�bkeyrrr�lookups6


�
�zRegistryInfo.lookupN)F)rrrr�rrrrrr�rtr�r�r�r�r�r�r�r�r�r�r�r�rrrrr��s6
�









r�c@s<eZdZdZe�dd�Ze�dd�Ze�de�Zd7dd�Z	d	d
�Z
dd�Zd
d�Ze
dd��Zedd��Zedd��Zdd�Zdd�Zedd��Zedd��Zedd��Zedd ��Zed!d"��Zed#d$��Zed%d&��Zed'd(��Zed)d*��Zed+d,��Zed-d.��Zed/d0��Zed1d2��Z d3d4�Z!e
d8d5d6��Z"dS)9�
SystemInfoz�
    Microsoft Windows and Visual Studio related system information.

    Parameters
    ----------
    registry_info: RegistryInfo
        "RegistryInfo" instance.
    vc_ver: float
        Required Microsoft Visual C++ version.
    �WinDirrjr-r,NcCs2||_|jj|_|��|_|p$|��|_|_dSr�)�rir��find_programdata_vs_vers�known_vs_paths�_find_latest_available_vs_ver�vs_ver�vc_ver)rsZ
registry_infor�rrrrt[s

zSystemInfo.__init__cCs>|��}|s|jstj�d��t|�}|�|j�t|�dS)zm
        Find the latest VC version

        Return
        ------
        float
            version
        z%No Microsoft Visual C++ version foundrF)�find_reg_vs_versr�r^r3r_�set�update�sorted)rsZreg_vc_versZvc_versrrrr�ds	
�z(SystemInfo._find_latest_available_vs_vercCsj|jj}|jj|jj|jjf}g}t�|jj|�D�],\}}zt�	|||�dtj
�}WntylYq2Yn0|��t�|�\}}}	t
|�D]T}
t�t��6tt�||
�d�}||vr�|�|�Wd�q�1s�0Yq�t
|�D]T}
t�t��4tt�||
��}||v�r|�|�Wd�q�1�s40Yq�Wd�q21�sV0Yq2t|�S)z�
        Find Microsoft Visual Studio versions available in registry.

        Return
        ------
        list of float
            Versions
        rN)r�r�r�r�r�r�productr�rrrrZQueryInfoKey�ranger7r8r#r"r �appendZEnumKeyr�)rsr�ZvckeysZvs_versr�r%r�Zsubkeys�valuesrLr(�verrrrr�xs*	
*
NzSystemInfo.find_reg_vs_versc	
Cs�i}d}zt|�}Wnty*|YS0|D]�}zpt||d�}t|ddd��}t�|�}Wd�n1sp0Y|d}tt|d��|||�|d	�<Wq0ttfy�Yq0Yq00q0|S)
z�
        Find Visual studio 2017+ versions from information in
        "C:\ProgramData\Microsoft\VisualStudio\Packages\_Instances".

        Return
        ------
        dict
            float version as key, path as value.
        z9C:\ProgramData\Microsoft\VisualStudio\Packages\_Instancesz
state.jsonZrtzutf-8)r2Nr.�
VC\Tools\MSVCZinstallationVersion)rrr�open�json�load�_as_float_version�KeyError)	rsZvs_versionsZ
instances_dirZhashed_namesr�Z
state_pathZ
state_file�stateZvs_pathrrrr��s$

(�z#SystemInfo.find_programdata_vs_verscCstd�|�d�dd���S)z�
        Return a string version as a simplified float version (major.minor)

        Parameters
        ----------
        version: str
            Version.

        Return
        ------
        float
            version
        �.N�)r"r�split)r*rrrr��szSystemInfo._as_float_versioncCs.t|jd|j�}|j�|jjd|j�p,|S)zp
        Microsoft Visual Studio directory.

        Return
        ------
        str
            path
        zMicrosoft Visual Studio %0.1f�%0.1f)r�ProgramFilesx86r�r�r�r�)rs�defaultrrr�VSInstallDir�s�zSystemInfo.VSInstallDircCs,|��p|��}t|�s(d}tj�|��|S)zm
        Microsoft Visual C++ directory.

        Return
        ------
        str
            path
        z(Microsoft Visual C++ directory not found)�	_guess_vc�_guess_vc_legacyrr^r3r_)rsr?�msgrrr�VCInstallDir�s

zSystemInfo.VCInstallDirc	Cs�|jdkrdSz|j|j}Wnty6|j}Yn0t|d�}z$t|�d}|�|�|_t||�WStt	fy~YdS0dS)zl
        Locate Visual C++ for VS2017+.

        Return
        ------
        str
            path
        rgrjr�rFN)
r�r�r�r�rrr�r�r�
IndexError)rsZvs_dirZguess_vcr�rrrr��s	

zSystemInfo._guess_vccCsbt|jd|j�}t|jjd|j�}|j�|d�}|rBt|d�n|}|j�|jjd|j�p`|S)z{
        Locate Visual C++ for versions prior to 2017.

        Return
        ------
        str
            path
        z Microsoft Visual Studio %0.1f\VCr��
installdirr4)rr�r�r�r�r�r�)rsr�Zreg_pathZ	python_vcZ
default_vcrrrr�s	�zSystemInfo._guess_vc_legacycCsJ|jdkrdS|jdkrdS|jdkr*dS|jdkr8dS|jd	krFd
SdS)z�
        Microsoft Windows SDK versions for specified MSVC++ version.

        Return
        ------
        tuple of str
            versions
        rk)z7.0z6.1z6.0arl)z7.1z7.0a�&@)z8.0z8.0a�(@)�8.1z8.1arg)z10.0r�N�r�rvrrr�WindowsSdkVersion)s





zSystemInfo.WindowsSdkVersioncCs|�t|jd��S)zt
        Microsoft Windows SDK last version.

        Return
        ------
        str
            version
        �lib)�_use_last_dir_namer�
WindowsSdkDirrvrrr�WindowsSdkLastVersion?s
z SystemInfo.WindowsSdkLastVersioncCsd}|jD],}t|jjd|�}|j�|d�}|r
q8q
|rDt|�stt|jjd|j�}|j�|d�}|rtt|d�}|r�t|�s�|jD]6}|d|�d��}d	|}t|j	|�}t|�r�|}q�|r�t|�s�|jD]$}d
|}t|j	|�}t|�r�|}q�|�st|j
d�}|S)zn
        Microsoft Windows SDK directory.

        Return
        ------
        str
            path
        rjzv%s�installationfolderr�r�ZWinSDKNr�zMicrosoft SDKs\Windows Kits\%szMicrosoft SDKs\Windows\v%sZPlatformSDK)r�rr�r�r�rr�r��rfindr-r�)rs�sdkdirr��locr?Zinstall_baseZintver�drrrr�Ks6




zSystemInfo.WindowsSdkDirc	Cs�|jdkrd}d}n&d}|jdkr&dnd}|jjd|d�}d	||�d
d�f}g}|jdkr~|jD]}|t|jj||�g7}qb|jD]}|t|jj	d
||�g7}q�|D]}|j�
|d�}|r�|Sq�dS)zy
        Microsoft Windows SDK executable directory.

        Return
        ------
        str
            path
        r��#rj�(r�TF)rBr�zWinSDK-NetFx%dTools%sr��-rgzv%sAr�N)r�r�r�rW�NetFxSdkVersionrr�r�r�r�r�)	rsZnetfxverrpr�ZfxZregpathsr�r?Zexecpathrrr�WindowsSDKExecutablePathvs$




z#SystemInfo.WindowsSDKExecutablePathcCs&t|jjd|j�}|j�|d�p$dS)zl
        Microsoft Visual F# directory.

        Return
        ------
        str
            path
        z%0.1f\Setup\F#Z
productdirrj)rr�r�r�r�)rsr?rrr�FSharpInstallDir�s
zSystemInfo.FSharpInstallDircCsF|jdkrdnd}|D]*}|j�|jjd|�}|r|p:dSqdS)zt
        Microsoft Universal CRT SDK directory.

        Return
        ------
        str
            path
        rg)Z10Z81rz
kitsroot%srjN)r�r�r�r�)rsZversr�r�rrr�UniversalCRTSdkDir�szSystemInfo.UniversalCRTSdkDircCs|�t|jd��S)z�
        Microsoft Universal C Runtime SDK last version.

        Return
        ------
        str
            version
        r�)r�rr�rvrrr�UniversalCRTSdkLastVersion�s
z%SystemInfo.UniversalCRTSdkLastVersioncCs|jdkrdSdS)z�
        Microsoft .NET Framework SDK versions.

        Return
        ------
        tuple of str
            versions
        rg)	z4.7.2z4.7.1z4.7z4.6.2z4.6.1z4.6z4.5.2z4.5.1z4.5rr�rvrrrr��s
��zSystemInfo.NetFxSdkVersioncCs8d}|jD](}t|jj|�}|j�|d�}|r
q4q
|S)zu
        Microsoft .NET Framework SDK directory.

        Return
        ------
        str
            path
        rjZkitsinstallationfolder)r�rr�r�r�)rsr�r�r�rrr�NetFxSdkDir�s

zSystemInfo.NetFxSdkDircCs"t|jd�}|j�|jjd�p |S)zw
        Microsoft .NET Framework 32bit directory.

        Return
        ------
        str
            path
        zMicrosoft.NET\FrameworkZframeworkdir32�rr�r�r�r��rsZguess_fwrrr�FrameworkDir32�szSystemInfo.FrameworkDir32cCs"t|jd�}|j�|jjd�p |S)zw
        Microsoft .NET Framework 64bit directory.

        Return
        ------
        str
            path
        zMicrosoft.NET\Framework64Zframeworkdir64r�r�rrr�FrameworkDir64�szSystemInfo.FrameworkDir64cCs
|�d�S)z�
        Microsoft .NET Framework 32bit versions.

        Return
        ------
        tuple of str
            versions
        � ��_find_dot_net_versionsrvrrr�FrameworkVersion32s
zSystemInfo.FrameworkVersion32cCs
|�d�S)z�
        Microsoft .NET Framework 64bit versions.

        Return
        ------
        tuple of str
            versions
        �@r�rvrrr�FrameworkVersion64s
zSystemInfo.FrameworkVersion64cCs�|j�|jjd|�}t|d|�}|p6|�|d�p6d}|jdkrJ|dfS|jdkrt|��dd	�d
krldn|dfS|jd
kr�dS|jdkr�dSdS)z�
        Find Microsoft .NET Framework versions.

        Parameters
        ----------
        bits: int
            Platform number of bits: 32 or 64.

        Return
        ------
        tuple of str
            versions
        zframeworkver%dzFrameworkDir%dr)rjr�zv4.0rlNr�Zv4z
v4.0.30319�v3.5rk)r��
v2.0.50727g @)zv3.0r�)r�r�r��getattrr�r�rQ)rs�bitsZreg_verZdot_net_dirr�rrrr�$s

 

z!SystemInfo._find_dot_net_versionscs*��fdd�tt���D�}t|d�p(dS)a)
        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 starting by this prefix

        Return
        ------
        str
            name
        c3s*|]"}tt�|��r|���r|VqdSr�)rr�
startswith)rRZdir_name�r?�prefixrrr[Rs�z0SystemInfo._use_last_dir_name.<locals>.<genexpr>Nrj)�reversedr�next)r?r�Z
matching_dirsrr�rr�As
�zSystemInfo._use_last_dir_name)N)rj)#rrrr�r
r6r�r-r�rtr�r�r��staticmethodr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�IsZ

	*





*
$








r�c@sTeZdZdZd=dd�Zedd��Zedd	��Zed
d��Zedd
��Z	edd��Z
edd��Zedd��Zedd��Z
edd��Zedd��Zedd��Zdd�Zedd��Zed d!��Zed"d#��Zed$d%��Zed&d'��Zed(d)��Zed*d+��Zed,d-��Zed.d/��Zed0d1��Zed2d3��Zed4d5��Zed6d7��Zd>d9d:�Zd;d<�Z dS)?�EnvironmentInfoaY
    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.X.

    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.
    NrcCsBt|�|_t|j�|_t|j|�|_|j|kr>d}tj�	|��dS)Nz.No suitable Microsoft Visual C++ version found)
rrr�r�r�r��sir�r^r3r_)rsrpr�Z
vc_min_ver�errrrrrtrs

zEnvironmentInfo.__init__cCs|jjS)zk
        Microsoft Visual Studio.

        Return
        ------
        float
            version
        )r�r�rvrrrr�{s
zEnvironmentInfo.vs_vercCs|jjS)zp
        Microsoft Visual C++ version.

        Return
        ------
        float
            version
        )r�r�rvrrrr��s
zEnvironmentInfo.vc_vercsVddg}�jdkrD�jjddd�}|dg7}|dg7}|d|g7}�fd	d
�|D�S)zu
        Microsoft Visual Studio Tools.

        Return
        ------
        list of str
            paths
        zCommon7\IDEz
Common7\ToolsrgT�r�rBz1Common7\IDE\CommonExtensions\Microsoft\TestWindowzTeam Tools\Performance ToolszTeam Tools\Performance Tools%scsg|]}t�jj|��qSr�rr�r��rRr?rvrr�
<listcomp>�rUz+EnvironmentInfo.VSTools.<locals>.<listcomp>)r�r�r�)rs�paths�arch_subdirrrvr�VSTools�s



zEnvironmentInfo.VSToolscCst|jjd�t|jjd�gS)z�
        Microsoft Visual C++ & Microsoft Foundation Class Includes.

        Return
        ------
        list of str
            paths
        ZIncludezATLMFC\Include�rr�r�rvrrr�
VCIncludes�s�zEnvironmentInfo.VCIncludescsb�jdkr�jjdd�}n�jjdd�}d|d|g}�jdkrP|d|g7}�fd	d
�|D�S)z�
        Microsoft Visual C++ & Microsoft Foundation Class Libraries.

        Return
        ------
        list of str
            paths
        �.@T�rB�r��Lib%szATLMFC\Lib%srgzLib\store%scsg|]}t�jj|��qSrr�r�rvrrr��rUz/EnvironmentInfo.VCLibraries.<locals>.<listcomp>)r�r�r�)rsr�r�rrvr�VCLibraries�s


zEnvironmentInfo.VCLibrariescCs|jdkrgSt|jjd�gS)z�
        Microsoft Visual C++ store references Libraries.

        Return
        ------
        list of str
            paths
        rgzLib\store\references)r�rr�r�rvrrr�VCStoreRefs�s

zEnvironmentInfo.VCStoreRefscCs|j}t|jd�g}|jdkr"dnd}|j�|�}|rL|t|jd|�g7}|jdkr|d|jjdd�}|t|j|�g7}n�|jdkr�|j��r�d	nd
}|t|j||jjdd��g7}|jj	|jj
kr�|t|j||jjdd��g7}n|t|jd�g7}|S)
zr
        Microsoft Visual C++ Tools.

        Return
        ------
        list of str
            paths
        Z
VCPackagesrlTF�Bin%srgr�r�z
bin\HostX86%sz
bin\HostX64%sr��Bin)r�rr�r�r�r�r�r|r�r{rw)rsr��toolsr�r�r?Zhost_dirrrr�VCTools�s&


� �zEnvironmentInfo.VCToolscCsh|jdkr.|jjddd�}t|jjd|�gS|jjdd�}t|jjd�}|j}t|d||f�gSdS)	zw
        Microsoft Windows SDK Libraries.

        Return
        ------
        list of str
            paths
        rlTr�r�r�r�z%sum%sN)r�r�r�rr�r��_sdk_subdir)rsr�r�Zlibverrrr�OSLibraries�s

zEnvironmentInfo.OSLibrariescCsht|jjd�}|jdkr&|t|d�gS|jdkr8|j}nd}t|d|�t|d|�t|d|�gSd	S)
zu
        Microsoft Windows SDK Include.

        Return
        ------
        list of str
            paths
        �includerl�glrgrjz%ssharedz%sumz%swinrtN)rr�r�r�r)rsr�sdkverrrr�
OSIncludess


�zEnvironmentInfo.OSIncludescCs�t|jjd�}g}|jdkr&||j7}|jdkr@|t|d�g7}|jdkr�||t|jjd�t|dd�t|d	d�t|d
d�t|jjddd
|jddd�g7}|S)z}
        Microsoft Windows SDK Libraries Paths.

        Return
        ------
        list of str
            paths
        Z
Referencesrkr�zCommonConfiguration\NeutralrgZ
UnionMetadataz'Windows.Foundation.UniversalApiContractz1.0.0.0z%Windows.Foundation.FoundationContractz,Windows.Networking.Connectivity.WwanContractZ
ExtensionSDKszMicrosoft.VCLibsr�ZCommonConfigurationZneutral)rr�r�r�r)rs�ref�libpathrrr�	OSLibpath-s0







��zEnvironmentInfo.OSLibpathcCst|���S)zs
        Microsoft Windows SDK Tools.

        Return
        ------
        list of str
            paths
        )�list�
_sdk_toolsrvrrr�SdkToolsSs
zEnvironmentInfo.SdkToolsccs�|jdkr,|jdkrdnd}t|jj|�V|j��s\|jjdd�}d|}t|jj|�V|jdvr�|j��rvd	}n|jjddd
�}d|}t|jj|�VnB|jdkr�t|jjd�}|jjdd�}|jj}t|d||f�V|jj	r�|jj	Vd
S)z�
        Microsoft Windows SDK Tools paths generator.

        Return
        ------
        generator of str
            paths
        r�r�rzBin\x86Tr�r)rlr�rjr�zBin\NETFX 4.0 Tools%sz%s%sN)
r�rr�r�r�r|r�ryr�r�)rsZbin_dirr�r?rrrrr_s(	




zEnvironmentInfo._sdk_toolscCs|jj}|rd|SdS)zu
        Microsoft Windows SDK version subdir.

        Return
        ------
        str
            subdir
        �%s\rj)r�r��rs�ucrtverrrrr�s
zEnvironmentInfo._sdk_subdircCs|jdkrgSt|jjd�gS)zs
        Microsoft Windows SDK Setup.

        Return
        ------
        list of str
            paths
        rkZSetup)r�rr�r�rvrrr�SdkSetup�s

zEnvironmentInfo.SdkSetupcs�|j}|j�|jdkr0d}|��o,|��}n$|��p>|��}|jdkpR|jdk}g}|rt|�fdd��jD�7}|r�|�fdd��jD�7}|S)zv
        Microsoft .NET Framework Tools.

        Return
        ------
        list of str
            paths
        rlTrCcsg|]}t�j|��qSr)rr��rRr��r�rrr��rUz+EnvironmentInfo.FxTools.<locals>.<listcomp>csg|]}t�j|��qSr)rr�rrrrr��rU)	r�r�r�ryr|r{rwr�r�)rsr�Z	include32Z	include64rrrr�FxTools�s

zEnvironmentInfo.FxToolscCs8|jdks|jjsgS|jjdd�}t|jjd|�gS)z~
        Microsoft .Net Framework SDK Libraries.

        Return
        ------
        list of str
            paths
        rgTr�zlib\um%s)r�r�r�r�r�r)rsr�rrr�NetFxSDKLibraries�s
z!EnvironmentInfo.NetFxSDKLibrariescCs&|jdks|jjsgSt|jjd�gS)z}
        Microsoft .Net Framework SDK Includes.

        Return
        ------
        list of str
            paths
        rgz
include\um)r�r�r�rrvrrr�NetFxSDKIncludes�s
z EnvironmentInfo.NetFxSDKIncludescCst|jjd�gS)z�
        Microsoft Visual Studio Team System Database.

        Return
        ------
        list of str
            paths
        z
VSTSDB\Deployr�rvrrr�VsTDb�s
zEnvironmentInfo.VsTDbcCsv|jdkrgS|jdkr0|jj}|jjdd�}n|jj}d}d|j|f}t||�g}|jdkrr|t||d�g7}|S)zn
        Microsoft Build Engine.

        Return
        ------
        list of str
            paths
        r�r�Tr�rjzMSBuild\%0.1f\bin%sZRoslyn)r�r�r�r�r�r�r)rs�	base_pathr�r?Zbuildrrr�MSBuild�s



zEnvironmentInfo.MSBuildcCs|jdkrgSt|jjd�gS)zt
        Microsoft HTML Help Workshop.

        Return
        ------
        list of str
            paths
        r�zHTML Help Workshop)r�rr�r�rvrrr�HTMLHelpWorkshops

z EnvironmentInfo.HTMLHelpWorkshopcCsD|jdkrgS|jjdd�}t|jjd�}|j}t|d||f�gS)z�
        Microsoft Universal C Runtime SDK Libraries.

        Return
        ------
        list of str
            paths
        rgTr�r�z%sucrt%s)r�r�r�rr�r��_ucrt_subdir)rsr�r�rrrr�
UCRTLibrariess

zEnvironmentInfo.UCRTLibrariescCs.|jdkrgSt|jjd�}t|d|j�gS)z�
        Microsoft Universal C Runtime SDK Include.

        Return
        ------
        list of str
            paths
        rgrz%sucrt)r�rr�r�r)rsrrrr�UCRTIncludes!s

zEnvironmentInfo.UCRTIncludescCs|jj}|rd|SdS)z�
        Microsoft Universal C Runtime SDK version subdir.

        Return
        ------
        str
            subdir
        rrj)r�r�rrrrr1s
zEnvironmentInfo._ucrt_subdircCs(d|jkrdkrnngS|jjgS)zk
        Microsoft Visual F#.

        Return
        ------
        list of str
            paths
        r�r�)r�r�r�rvrrr�FSharp>s
zEnvironmentInfo.FSharpc
Cs�d|j}|jjdd��d�}g}|jj}t|�dd��}t|�rft	|t
|�d�}||t	|d�g7}|t	|d	�g7}d
|jdd
t|j�df}t
�||�D]&\}}t	||||�}	t|	�r�|	Sq�dS)
z
        Microsoft Visual C++ runtime redistributable dll.

        Return
        ------
        str
            path
        zvcruntime%d0.dllTr�r�z\Toolsz\RedistrFZonecorerDzMicrosoft.VC%d.CRT�
N)r�r�r�r=r�r�rrWrrrr!r�rr�r)
rsrMr��prefixesZ
tools_pathZredist_pathZcrt_dirsr�Zcrt_dirr?rrr�VCRuntimeRedistMs 

�zEnvironmentInfo.VCRuntimeRedistTcCs�t|�d|j|j|j|jg|�|�d|j|j|j|j	|j
g|�|�d|j|j|j|jg|�|�d|j
|j|j|j|j|j|j|j|jg	|�d�}|jdkr�t|j�r�|j|d<|S)z�
        Return environment dict.

        Parameters
        ----------
        exists: bool
            It True, only return existing paths.

        Return
        ------
        dict
            environment
        rr�rr?)rr�rr?rr\)�dict�_build_pathsr�r	rrr�rrrrr�rrr�rrrrrr r�rr#)rs�existsrerrr�
return_envrsV��
������+
zEnvironmentInfo.return_envc
Csntj�|�}t�|d��t�}t�||�}|r<ttt	|��n|}|s\d|�
�}tj�
|��t|�}	t�|	�S)aC
        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.

        Parameters
        ----------
        name: str
            Environment variable name
        spec_path_lists: list of str
            Paths
        exists: bool
            It True, only return existing paths.

        Return
        ------
        str
            Pathsep-separated paths
        rjz %s environment variable is empty)r�chain�
from_iterabler
r6r�rr
�filterr�upperr^r3r_rr)
rsr�Zspec_path_listsr&Z
spec_pathsZ	env_pathsr�Zextant_pathsr�Zunique_pathsrrrr%�szEnvironmentInfo._build_paths)Nr)T)!rrrr�rtr�r�r�r�r�r�r�rrr	rrrrrrrrrrrrrrr r#r'r%rrrrr�Zsj
	







%


%
#












$
=r�)rj)'r�r��osrrZos.pathrrrrr:rr7�platformrZdistutils.errorsr^�typingr	r
Z setuptools.extern.more_itertoolsr�systemrr
r$�str�__annotations__r+r@rGrOrfrirhrrr�r�r�rrrr�<module>sH
0�5
'y>

Youez - 2016 - github.com/yon3zu
LinuXploit