Edit File: msvc.cpython-36.opt-1.pyc
3 U('d��������������������@���s��d�Z�ddlZddlZddlZddlZddlZddlmZ�ddl m Z �ddlmZ�ej ��dkrpddl mZ�ejZnG�d d ��d �Ze��ZeejjfZyddlmZ�W�n�ek r����Y�nX�dd ��Zd dd�Zdd��Zdd��Zd!dd�ZG�dd��d�ZG�dd��d�ZG�dd��d�ZG�dd��d�Z 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_unpatched�Windows)�winregc���������������@���s���e�Zd�ZdZdZdZdZdS�)r���N)�__name__� __module__�__qualname__� HKEY_USERS�HKEY_CURRENT_USER�HKEY_LOCAL_MACHINE�HKEY_CLASSES_ROOT��r���r����/usr/lib/python3.6/msvc.pyr���(���s���r���)�Regc�������������C���s����d}|d|�f�}yt�j|d�}W�nJ�tk rj���y|d|�f�}t�j|d�}W�n�tk rd���d}Y�nX�Y�nX�|r�tjjjj|d�}tjj|�r�|S�tt�|��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��� installdirzWow6432Node\Nz vcvarsall.bat) r���Z get_value�KeyError�os�path�join�isfiler����msvc9_find_vcvarsall)�versionZVC_BASE�key� productdir� vcvarsallr���r���r���r���?���s����r����x86c�������������O���s����yt�t�}||�|f|�|�S��tjjk r2���Y�n�tk rD���Y�nX�yt||��j��S��tjjk r��}�zt||�|����W�Y�dd}~X�nX�dS�)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) r����msvc9_query_vcvarsall� distutils�errors�DistutilsPlatformError� ValueError�EnvironmentInfo� return_env�_augment_exception)�ver�arch�args�kwargsZorig�excr���r���r���r���j���s����r���c�������������C���sn���yt�t�|��S��tjjk r$���Y�nX�yt|�dd�j��S��tjjk rh�}�zt|d����W�Y�dd}~X�nX�dS�)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 g������,@)� vc_min_verN)r����msvc14_get_vc_envr ���r!���r"���r$���r%���r&���)Z plat_specr+���r���r���r���r-�������s���� r-���c��������������O���sB���dt�jkr4ddl}t|j�td�k�r4|jjj|�|�S�tt �|�|�S�)z� Patched "distutils._msvccompiler.gen_lib_options" for fix compatibility between "numpy.distutils" and "distutils._msvccompiler" (for Numpy < 1.11.2) znumpy.distutilsr���Nz1.11.2) �sys�modulesZnumpyr����__version__r ���Z ccompilerZgen_lib_optionsr����msvc14_gen_lib_options)r)���r*���Znpr���r���r���r1�������s ���� r1���r���c�������������C���s����|�j�d�}d|j��ks"d|j��kr�d}|jf�t���}d}|dkrr|j��jd�dkrh|d 7�}||d �7�}q�|d7�}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. r���r���zvisual cz0Microsoft Visual C++ {version:0.1f} is required.z-www.microsoft.com/download/details.aspx?id=%dg������"@Zia64r���z* 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)����lower�format�locals�find)r+���r���r(����messageZtmplZ msdownloadr���r���r���r&�������s ���� r&���c���������������@���sb���e�Zd�ZdZejdd�j��Zdd��Ze dd���Z dd ��Zd d��Zdd d�Z ddd�Zddd�ZdS�)�PlatformInfoz� Current and Target Architectures informations. Parameters ---------- arch: str Target architecture. Zprocessor_architecturer���c�������������C���s���|j���jdd�|�_d�S�)N�x64�amd64)r3����replacer(���)�selfr(���r���r���r����__init__����s����zPlatformInfo.__init__c�������������C���s���|�j�|�j�jd�d�d���S�)N�_r���)r(���r6���)r<���r���r���r���� target_cpu����s����zPlatformInfo.target_cpuc�������������C���s ���|�j�dkS�)Nr���)r?���)r<���r���r���r���� target_is_x86��s����zPlatformInfo.target_is_x86c�������������C���s ���|�j�dkS�)Nr���)�current_cpu)r<���r���r���r����current_is_x86��s����zPlatformInfo.current_is_x86Fc�������������C���s.���|�j�dkr|rdS�|�j�dkr$|r$dS�d|�j��S�)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) r���r���r:���z\x64z\%s)rA���)r<����hidex86r9���r���r���r����current_dir ��s����zPlatformInfo.current_dirc�������������C���s.���|�j�dkr|rdS�|�j�dkr$|r$dS�d|�j��S�)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) r���r���r:���z\x64z\%s)r?���)r<���rC���r9���r���r���r���� target_dir��s����zPlatformInfo.target_dirc�������������C���s0���|rdn|�j�}|�j|krdS�|�j��jdd|��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. r���r����\z\%s_)rA���r?���rE���r;���)r<����forcex86Zcurrentr���r���r���� cross_dir5��s����zPlatformInfo.cross_dirN)FF)FF)F)r���r ���r ����__doc__�safe_env�getr3���rA���r=����propertyr?���r@���rB���rD���rE���rH���r���r���r���r���r8�������s��� r8���c���������������@���s����e�Zd�ZdZejejejejfZ dd��Z edd���Zedd���Z edd ���Zed d���Zedd ���Zedd���Zedd���Zedd���Zedd���Zddd�Zdd��ZdS�)�RegistryInfoz� Microsoft Visual Studio related registry informations. Parameters ---------- platform_info: PlatformInfo "PlatformInfo" instance. c�������������C���s ���||�_�d�S�)N)�pi)r<���Z platform_infor���r���r���r=���Z��s����zRegistryInfo.__init__c�������������C���s���dS�)z< Microsoft Visual Studio root registry key. ZVisualStudior���)r<���r���r���r����visualstudio]��s����zRegistryInfo.visualstudioc�������������C���s���t�jj|�jd�S�)z; Microsoft Visual Studio SxS registry key. ZSxS)r���r���r���rO���)r<���r���r���r����sxsd��s����zRegistryInfo.sxsc�������������C���s���t�jj|�jd�S�)z8 Microsoft Visual C++ VC7 registry key. ZVC7)r���r���r���rP���)r<���r���r���r����vck��s����zRegistryInfo.vcc�������������C���s���t�jj|�jd�S�)z; Microsoft Visual Studio VS7 registry key. ZVS7)r���r���r���rP���)r<���r���r���r����vsr��s����zRegistryInfo.vsc�������������C���s���dS�)z? Microsoft Visual C++ for Python registry key. zDevDiv\VCForPythonr���)r<���r���r���r���� vc_for_pythony��s����zRegistryInfo.vc_for_pythonc�������������C���s���dS�)z- Microsoft SDK registry key. zMicrosoft SDKsr���)r<���r���r���r���� microsoft_sdk���s����zRegistryInfo.microsoft_sdkc�������������C���s���t�jj|�jd�S�)z> Microsoft Windows/Platform SDK registry key. r���)r���r���r���rT���)r<���r���r���r����windows_sdk���s����zRegistryInfo.windows_sdkc�������������C���s���t�jj|�jd�S�)z< Microsoft .NET Framework SDK registry key. ZNETFXSDK)r���r���r���rT���)r<���r���r���r���� netfx_sdk���s����zRegistryInfo.netfx_sdkc�������������C���s���dS�)z< Microsoft Windows Kits Roots registry key. zWindows Kits\Installed Rootsr���)r<���r���r���r����windows_kits_roots���s����zRegistryInfo.windows_kits_rootsFc�������������C���s(���|�j�j��s|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 r���ZWow6432NodeZSoftwareZ Microsoft)rN���rB���r���r���r���)r<���r���r���Znode64r���r���r���� microsoft���s����zRegistryInfo.microsoftc�������������C���s����t�j}t�j}|�j}x�|�jD�]�}y||||�d|�}W�nZ�ttfk r����|�jj��s�y||||d�d|�}W�q��ttfk r����wY�q�X�nwY�nX�yt�j ||�d�S��ttfk r����Y�qX�qW�dS�)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 r���TN) r����KEY_READ�OpenKeyrX����HKEYS�OSError�IOErrorrN���rB���ZQueryValueEx)r<���r����namerY���Zopenkey�ms�hkey�bkeyr���r���r����lookup���s"���� zRegistryInfo.lookupN)F)r���r ���r ���rI���r���r���r���r ���r���r[���r=���rL���rO���rP���rQ���rR���rS���rT���rU���rV���rW���rX���rb���r���r���r���r���rM���L��s"��� rM���c���������������@���s$��e�Zd�ZdZejdd�Zejdd�Zejde�Zd3dd�Z d d ��Z dd��Zed d���Z edd���Zdd��Zdd��Zedd���Zedd���Zedd���Zedd���Zedd���Zedd ���Zed!d"���Zed#d$���Zed%d&���Zed'd(���Zed)d*���Zed+d,���Zed-d.���Zd/d0��Zd4d1d2�ZdS�)5� 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)Nc�������������C���s"���||�_�|�j�j|�_|p|�j��|�_d�S�)N)�rirN����_find_latest_available_vc_ver�vc_ver)r<���Z registry_inforh���r���r���r���r=������s���� zSystemInfo.__init__c�������������C���s6���y|�j���d�S��tk r0���d}tjj|��Y�nX�d�S�)Nr���z%No Microsoft Visual C++ version foundr2���)�find_available_vc_vers� IndexErrorr ���r!���r"���)r<����errr���r���r���rg������s ����z(SystemInfo._find_latest_available_vc_verc�������������C���s6��|�j�j}|�j�j|�j�j|�j�jf}g�}�x|�j�jD�]�}x�|D�]�}ytj|||�dtj�}W�n�t t fk rp���w8Y�nX�tj|�\}}} xPt|�D�]D} y*t tj|| �d��}||kr�|j|��W�q��tk r����Y�q�X�q�W�xPt|�D�]D} y(t tj|| ��}||k�r|j|��W�q��tk �r ���Y�q�X�q�W�q8W�q.W�t|�S�)zC Find all available Microsoft Visual C++ versions. r���)rf���rX���rQ���rS���rR���r[���r���rZ���rY���r\���r]���ZQueryInfoKey�range�floatZ EnumValue�appendr#���ZEnumKey�sorted)r<���r_���ZvckeysZvc_versr`���r���ra���Zsubkeys�valuesr>����ir'���r���r���r���ri������s2���� z!SystemInfo.find_available_vc_versc�������������C���s6���d|�j��}tjj|�j|�}|�jj|�jjd|�j���p4|S�)z4 Microsoft Visual Studio directory. zMicrosoft Visual Studio %0.1fz%0.1f)rh���r���r���r����ProgramFilesx86rf���rb���rR���)r<���r^����defaultr���r���r����VSInstallDir ��s���� zSystemInfo.VSInstallDirc�������������C���s����|�j��|�j��p|�j��}tjj|�jjd|�j��}|�jj |d�}|rNtjj|d�n|}|�jj |�jj d|�j��pl|}tjj|�s�d}tj j|��|S�)z1 Microsoft Visual C++ directory. z%0.1fr���ZVCz(Microsoft Visual C++ directory not found)rt���� _guess_vc�_guess_vc_legacyr���r���r���rf���rS���rh���rb���rQ����isdirr ���r!���r"���)r<����guess_vcZreg_pathZ python_vcZ default_vcr����msgr���r���r����VCInstallDir��s����zSystemInfo.VCInstallDirc���������� ���C���s^���|�j�dkrdS�d}tjj|�j|�}ytj|�d�}tjj||�S��tttfk rX���Y�nX�dS�)z* Locate Visual C for 2017 g������,@Nz VC\Tools\MSVCr���r2���) rh���r���r���r���rt����listdirr\���r]���rj���)r<���rs���rx���Zvc_exact_verr���r���r���ru���0��s���� zSystemInfo._guess_vcc�������������C���s���d|�j��}tjj|�j|�S�)z< Locate Visual C for versions prior to 2017 z Microsoft Visual Studio %0.1f\VC)rh���r���r���r���rr���)r<���rs���r���r���r���rv���@��s���� zSystemInfo._guess_vc_legacyc�������������C���sJ���|�j�dkrdS�|�j�dkrdS�|�j�dkr*dS�|�j�dkr8dS�|�j�dkrFdS�dS�)zN Microsoft Windows SDK versions for specified MSVC++ version. g������"@�7.0�6.1�6.0ag������$@�7.1�7.0ag������&@�8.0�8.0ag������(@�8.1�8.1ag������,@�10.0N)r|���r}���r~���)r���r����)r����r����)r����r����)r����r����)rh���)r<���r���r���r����WindowsSdkVersionG��s���� zSystemInfo.WindowsSdkVersionc�������������C���s���|�j�tjj|�jd��S�)z4 Microsoft Windows SDK last version �lib)�_use_last_dir_namer���r���r���� WindowsSdkDir)r<���r���r���r����WindowsSdkLastVersionW��s���� z SystemInfo.WindowsSdkLastVersionc�������������C���sT��d}x8|�j�D�].}tjj|�jjd|��}|�jj|d�}|rP�qW�|�sRtjj|��r�tjj|�jjd|�j ��}|�jj|d�}|r�tjj|d�}|�s�tjj|��r�xH|�j�D�]>}|d|j d���}d |�}tjj|�j|�}tjj|�r�|}q�W�|�s�tjj|���r:x:|�j�D�]0}d |�}tjj|�j|�}tjj|��r|}�qW�|�sPtjj|�jd�}|S�)z2 Microsoft Windows SDK directory. r���zv%s�installationfolderz%0.1fr���ZWinSDKN�.zMicrosoft SDKs\Windows Kits\%szMicrosoft SDKs\Windows\v%sZPlatformSDK) r����r���r���r���rf���rU���rb���rw���rS���rh����rfindre���rz���)r<����sdkdirr'����locr���Zinstall_baseZintver�dr���r���r���r����_��s6���� zSystemInfo.WindowsSdkDirc������� ������C���s����|�j�dkrd}d}n&d}|�j�dkr&dnd}|�jjd|d�}d ||jd d�f�}g�}|�j�dkr�x(|�jD�]}|tjj|�jj ||�g7�}qdW�x,|�j D�]"}|tjj|�jjd |�|�g7�}q�W�x |D�]}|�jj|d�}|r�P�q�W�|S�)z= Microsoft Windows SDK executable directory. g������&@�#���r����(���g������(@TF)r9���rC���zWinSDK-NetFx%dTools%srF����-g������,@zv%sAr����) rh���rN���rD���r;����NetFxSdkVersionr���r���r���rf���rV���r����rU���rb���) r<���Znetfxverr(���rC���ZfxZregpathsr'���r���Zexecpathr���r���r����WindowsSDKExecutablePath���s$���� " z#SystemInfo.WindowsSDKExecutablePathc�������������C���s.���d|�j��}tjj|�jj|�}|�jj|d�p,dS�)z0 Microsoft Visual F# directory. z%0.1f\Setup\F#r���r���)rh���r���r���r���rf���rO���rb���)r<���r���r���r���r����FSharpInstallDir���s���� zSystemInfo.FSharpInstallDirc�������������C���sF���|�j�dkrd}nf�}x(|D�] }|�jj|�jjd|��}|rP�qW�|pDdS�)z8 Microsoft Universal CRT SDK directory. g������,@�10�81z kitsroot%sr���)r����r����)rh���rf���rb���rW���)r<���Zversr'���r����r���r���r����UniversalCRTSdkDir���s���� zSystemInfo.UniversalCRTSdkDirc�������������C���s���|�j�tjj|�jd��S�)z@ Microsoft Universal C Runtime SDK last version r����)r����r���r���r���r����)r<���r���r���r����UniversalCRTSdkLastVersion���s���� z%SystemInfo.UniversalCRTSdkLastVersionc�������������C���s���|�j�dkrdS�f�S�dS�)z8 Microsoft .NET Framework SDK versions. g������,@�4.6.1�4.6N)r����r����)rh���)r<���r���r���r���r�������s���� zSystemInfo.NetFxSdkVersionc�������������C���s>���x4|�j�D�]*}tjj|�jj|�}|�jj|d�}|rP�qW�|p<dS�)z9 Microsoft .NET Framework SDK directory. Zkitsinstallationfolderr���)r����r���r���r���rf���rV���rb���)r<���r'���r����r����r���r���r����NetFxSdkDir���s����zSystemInfo.NetFxSdkDirc�������������C���s&���t�jj|�jd�}|�jj|�jjd�p$|S�)z; Microsoft .NET Framework 32bit directory. zMicrosoft.NET\FrameworkZframeworkdir32)r���r���r���rd���rf���rb���rQ���)r<����guess_fwr���r���r����FrameworkDir32���s����zSystemInfo.FrameworkDir32c�������������C���s&���t�jj|�jd�}|�jj|�jjd�p$|S�)z; Microsoft .NET Framework 64bit directory. zMicrosoft.NET\Framework64Zframeworkdir64)r���r���r���rd���rf���rb���rQ���)r<���r����r���r���r����FrameworkDir64���s����zSystemInfo.FrameworkDir64c�������������C���s ���|�j�d�S�)z: Microsoft .NET Framework 32bit versions. � ���)�_find_dot_net_versions)r<���r���r���r����FrameworkVersion32���s����zSystemInfo.FrameworkVersion32c�������������C���s ���|�j�d�S�)z: Microsoft .NET Framework 64bit versions. �@���)r����)r<���r���r���r����FrameworkVersion64���s����zSystemInfo.FrameworkVersion64c�������������C���s����|�j�j|�j�jd|��}t|�d|��}|p6|�j|d�p6d}|�jdkrL|df}n:|�jdkrx|j��dd ��d krndn|df}n|�jd kr�d}|�jdkr�d}|S�)z� Find Microsoft .NET Framework versions. Parameters ---------- bits: int Platform number of bits: 32 or 64. zframeworkver%dzFrameworkDir%d�vr���g������(@zv4.0g������$@N����Zv4z v4.0.30319�v3.5g������"@� v2.0.50727g������ @�v3.0)r����r����)r����r����)rf���rb���rQ����getattrr����rh���r3���)r<����bitsZreg_verZdot_net_dirr'���Zframeworkverr���r���r���r������s���� z!SystemInfo._find_dot_net_versionsc����������������s,������fdd�t�tj����D��}t|d�p*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 c�������������3���s2���|�]*}t�jjt�jj��|��r|j��r|V��qd�S�)N)r���r���rw���r���� startswith)�.0Zdir_name)r����prefixr���r���� <genexpr>)��s���z0SystemInfo._use_last_dir_name.<locals>.<genexpr>Nr���)�reversedr���r{����next)r<���r���r����Z matching_dirsr���)r���r����r���r������s����zSystemInfo._use_last_dir_name)N)r���) r���r ���r ���rI���rJ���rK���rd���re���rr���r=���rg���ri���rL���rt���rz���ru���rv���r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r���r���r���r���rc������s4��� & rc���c���������������@���sR��e�Zd�ZdZd=dd�Zedd���Zedd ���Zed d���Zedd ���Z edd���Z edd���Zedd���Zedd���Z edd���Zedd���Zdd��Zedd���Zedd���Zed d!���Zed"d#���Zed$d%���Zed&d'���Zed(d)���Zed*d+���Zed,d-���Zed.d/���Zed0d1���Zed2d3���Zed4d5���Zd>d7d8�Zd9d:��Zd?d;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. Nr���c�������������C���sB���t�|�|�_t|�j�|�_t|�j|�|�_|�j|k�r>d}tjj |��d�S�)Nz.No suitable Microsoft Visual C++ version found) r8���rN���rM���rf���rc����sirh���r ���r!���r"���)r<���r(���rh���r,���rk���r���r���r���r=���I��s���� zEnvironmentInfo.__init__c�������������C���s���|�j�jS�)z/ Microsoft Visual C++ version. )r����rh���)r<���r���r���r���rh���R��s����zEnvironmentInfo.vc_verc����������������sV���ddg}��j�dkrD��jjddd�}|dg7�}|dg7�}|d|�g7�}��fd d �|D��S�)z/ Microsoft Visual Studio Tools zCommon7\IDEz Common7\Toolsg������,@T)rC���r9���z1Common7\IDE\CommonExtensions\Microsoft\TestWindowzTeam Tools\Performance ToolszTeam Tools\Performance Tools%sc����������������s���g�|�]}t�jj��jj|��qS�r���)r���r���r���r����rt���)r����r���)r<���r���r���� <listcomp>f��s����z+EnvironmentInfo.VSTools.<locals>.<listcomp>)rh���rN���rD���)r<����paths�arch_subdirr���)r<���r����VSToolsY��s���� zEnvironmentInfo.VSToolsc�������������C���s$���t�jj|�jjd�t�jj|�jjd�gS�)zL Microsoft Visual C++ & Microsoft Foundation Class Includes ZIncludezATLMFC\Include)r���r���r���r����rz���)r<���r���r���r���� VCIncludesh��s����zEnvironmentInfo.VCIncludesc����������������sb�����j�dkr��jjdd�}n��jjdd�}d|�d|�g}��j�dkrP|d|�g7�}��fd d �|D��S�)zM Microsoft Visual C++ & Microsoft Foundation Class Libraries g������.@T)r9���)rC���zLib%szATLMFC\Lib%sg������,@zLib\store%sc����������������s���g�|�]}t�jj��jj|��qS�r���)r���r���r���r����rz���)r����r���)r<���r���r���r����~��s����z/EnvironmentInfo.VCLibraries.<locals>.<listcomp>)rh���rN���rE���)r<���r����r����r���)r<���r����VCLibrariesp��s���� zEnvironmentInfo.VCLibrariesc�������������C���s"���|�j�dk�rg�S�tjj|�jjd�gS�)zA Microsoft Visual C++ store references Libraries g������,@zLib\store\references)rh���r���r���r���r����rz���)r<���r���r���r����VCStoreRefs���s���� zEnvironmentInfo.VCStoreRefsc�������������C���s��|�j�}tjj|jd�g}|�jdkr&dnd}|�jj|�}|rT|tjj|jd|��g7�}|�jdkr�d|�jjdd��}|tjj|j|�g7�}n�|�jdkr�|�jj ��r�d nd }|tjj|j||�jj dd���g7�}|�jj|�jjkr�|tjj|j||�jjdd���g7�}n|tjj|jd�g7�}|S�) z, Microsoft Visual C++ Tools Z VCPackagesg������$@TFzBin%sg������,@)rC���g������.@z bin\HostX86%sz bin\HostX64%s)r9����Bin) r����r���r���r���rz���rh���rN���rH���rD���rB���rE���rA���r?���)r<���r�����toolsrG���r����r���Zhost_dirr���r���r����VCTools���s&���� zEnvironmentInfo.VCToolsc�������������C���st���|�j�dkr2|�jjddd�}tjj|�jjd|��gS�|�jjdd�}tjj|�jjd�}|�j}tjj|d||f��gS�dS�) z1 Microsoft Windows SDK Libraries g������$@T)rC���r9���zLib%s)r9���r����z%sum%sN) rh���rN���rE���r���r���r���r����r�����_sdk_subdir)r<���r����r����Zlibverr���r���r����OSLibraries���s���� zEnvironmentInfo.OSLibrariesc�������������C���s|���t�jj|�jjd�}|�jdkr.|t�jj|d�gS�|�jdkr@|�j}nd}t�jj|d|��t�jj|d|��t�jj|d|��gS�d S�) z/ Microsoft Windows SDK Include �includeg������$@Zglg������,@r���z%ssharedz%sumz%swinrtN)r���r���r���r����r����rh���r����)r<���r�����sdkverr���r���r���� OSIncludes���s���� zEnvironmentInfo.OSIncludesc�������������C���s����t�jj|�jjd�}g�}|�jdkr*||�j7�}|�jdkrH|t�jj|d�g7�}|�jdkr�||t�jj|�jjd�t�jj|dd�t�jj|d d�t�jj|d d�t�jj|�jjddd |�j�ddd�g7�}|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)r���r���r���r����r����rh���r����)r<����ref�libpathr���r���r���� OSLibpath���s>���� zEnvironmentInfo.OSLibpathc�������������C���s���t�|�j���S�)z- Microsoft Windows SDK Tools )�list� _sdk_tools)r<���r���r���r����SdkTools���s����zEnvironmentInfo.SdkToolsc�������������c���s��|�j�dk�r0|�j�dkrdnd}tjj|�jj|�V��|�jj��sd|�jjdd�}d|�}tjj|�jj|�V��|�j�dksx|�j�dkr�|�jj ��r�d }n|�jjddd �}d|�}tjj|�jj|�V��nL|�j�dk�rtjj|�jjd�}|�jjdd�}|�jj }tjj|d||f��V��|�jj�r|�jjV��d S�)z= Microsoft Windows SDK Tools paths generator g������.@g������&@r����zBin\x86T)r9���zBin%sg������$@r���)rC���r9���zBin\NETFX 4.0 Tools%sz%s%sN)rh���r���r���r���r����r����rN���rB���rD���r@���r����r����)r<���Zbin_dirr����r���r����r���r���r���r�������s(���� zEnvironmentInfo._sdk_toolsc�������������C���s���|�j�j}|rd|�S�dS�)z6 Microsoft Windows SDK version subdir z%s\r���)r����r����)r<����ucrtverr���r���r���r������s����zEnvironmentInfo._sdk_subdirc�������������C���s"���|�j�dkrg�S�tjj|�jjd�gS�)z- Microsoft Windows SDK Setup g������"@ZSetup)rh���r���r���r���r����r����)r<���r���r���r����SdkSetup%��s���� zEnvironmentInfo.SdkSetupc����������������s����|�j�}|�j��|�jdkr0d}|j���o,|j���}n$|j��p>|j��}|jdkpR|jdk}g�}|rt|��fdd���jD��7�}|r�|��fdd���jD��7�}|S�)z0 Microsoft .NET Framework Tools g������$@Tr:���c����������������s���g�|�]}t�jj��j|��qS�r���)r���r���r���r����)r����r'���)r����r���r���r����@��s���z+EnvironmentInfo.FxTools.<locals>.<listcomp>c����������������s���g�|�]}t�jj��j|��qS�r���)r���r���r���r����)r����r'���)r����r���r���r����C��s���) rN���r����rh���r@���rB���rA���r?���r����r����)r<���rN���Z include32Z include64r����r���)r����r����FxTools/��s���� zEnvironmentInfo.FxToolsc�������������C���s>���|�j�dk�s|�jj�rg�S�|�jjdd�}tjj|�jjd|��gS�)z8 Microsoft .Net Framework SDK Libraries g������,@T)r9���zlib\um%s)rh���r����r����rN���rE���r���r���r���)r<���r����r���r���r����NetFxSDKLibrariesG��s����z!EnvironmentInfo.NetFxSDKLibrariesc�������������C���s,���|�j�dk�s|�jj�rg�S�tjj|�jjd�gS�)z7 Microsoft .Net Framework SDK Includes g������,@z include\um)rh���r����r����r���r���r���)r<���r���r���r����NetFxSDKIncludesR��s����z EnvironmentInfo.NetFxSDKIncludesc�������������C���s���t�jj|�jjd�gS�)z> Microsoft Visual Studio Team System Database z VSTSDB\Deploy)r���r���r���r����rt���)r<���r���r���r����VsTDb\��s����zEnvironmentInfo.VsTDbc�������������C���s~���|�j�dk�rg�S�|�j�dk�r0|�jj}|�jjdd�}n|�jj}d}d|�j�|f�}tjj||�g}|�j�dkrz|tjj||d�g7�}|S�)z( Microsoft Build Engine g������(@g������.@T)rC���r���zMSBuild\%0.1f\bin%sZRoslyn) rh���r����rr���rN���rD���rt���r���r���r���)r<���� base_pathr����r���Zbuildr���r���r����MSBuildc��s���� zEnvironmentInfo.MSBuildc�������������C���s"���|�j�dk�rg�S�tjj|�jjd�gS�)z. Microsoft HTML Help Workshop g������&@zHTML Help Workshop)rh���r���r���r���r����rr���)r<���r���r���r����HTMLHelpWorkshopz��s���� z EnvironmentInfo.HTMLHelpWorkshopc�������������C���sL���|�j�dk�rg�S�|�jjdd�}tjj|�jjd�}|�j}tjj|d||f��gS�)z= Microsoft Universal C Runtime SDK Libraries g������,@T)r9���r����z%sucrt%s) rh���rN���rE���r���r���r���r����r�����_ucrt_subdir)r<���r����r����r����r���r���r���� UCRTLibraries���s���� zEnvironmentInfo.UCRTLibrariesc�������������C���s6���|�j�dk�rg�S�tjj|�jjd�}tjj|d|�j��gS�)z; Microsoft Universal C Runtime SDK Include g������,@r����z%sucrt)rh���r���r���r���r����r����r����)r<���r����r���r���r����UCRTIncludes���s���� zEnvironmentInfo.UCRTIncludesc�������������C���s���|�j�j}|rd|�S�dS�)zB Microsoft Universal C Runtime SDK version subdir z%s\r���)r����r����)r<���r����r���r���r���r�������s����zEnvironmentInfo._ucrt_subdirc�������������C���s ���|�j�dk�r|�j�dkrg�S�|�jjS�)z% Microsoft Visual F# g������&@g������(@)rh���r����r����)r<���r���r���r����FSharp���s����zEnvironmentInfo.FSharpc�������������C���sl���|�j�jdd�}|�jdk�r&|�jj}d}n|�jjjdd�}d}|�jdkrHdn|�j}|||�j|f�}tjj||�S�) zA Microsoft Visual C++ runtime redistribuable dll T)r9�������z-redist%s\Microsoft.VC%d0.CRT\vcruntime%d0.dllz\Toolsz\Redistz.onecore%s\Microsoft.VC%d0.CRT\vcruntime%d0.dllg������,@) rN���rE���rh���r����rz���r;���r���r���r���)r<���r����Zredist_pathZ vcruntimeZdll_verr���r���r����VCRuntimeRedist���s���� zEnvironmentInfo.VCRuntimeRedistTc�������������C���s����t�|�jd|�j|�j|�j|�jg|�|�jd|�j|�j|�j|�j |�j g|�|�jd|�j|�j|�j|�jg|�|�jd|�j |�j|�j|�j|�j|�j|�j|�j|�jg |�d�}|�jdkr�tjj|�j�r�|�j|d<�|S�)z� Return environment dict. Parameters ---------- exists: bool It True, only return existing paths. r����r����r����r���)r����r����r����r�������Zpy_vcruntime_redist)�dict�_build_pathsr����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����rh���r���r���r���r����)r<����exists�envr���r���r���r%������sD���� zEnvironmentInfo.return_envc������� ������C���sx���t�jj|�}tj|d�jtj�}t�j||�}|rBtt tj j|��n|}|sbd|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. r���z %s environment variable is empty)� itertools�chain� from_iterablerJ���rK����splitr����pathsepr�����filterr���rw����upperr ���r!���r"����_unique_everseenr���) r<���r^���Zspec_path_listsr����Z spec_pathsZ env_pathsr����Zextant_pathsry���Zunique_pathsr���r���r���r�������s���� zEnvironmentInfo._build_pathsc�������������c���sj���t���}|j}|dkr:xPt|j|�D�]}||��|V��q"W�n,x*|D�]"}||�}||kr@||��|V��q@W�dS�)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)�set�addr����__contains__)r<����iterabler����seenZseen_add�element�kr���r���r���r������s���� z EnvironmentInfo._unique_everseen)Nr���)T)N)!r���r ���r ���rI���r=���rL���rh���r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r%���r����r����r���r���r���r���r$���1��s:��� - -r$���)r���)r���)!rI���r���r.����platformr����Zdistutils.errorsr ���Z#setuptools.extern.packaging.versionr���Zsetuptools.extern.six.movesr���Zmonkeyr����systemr����environrJ���r�����ImportErrorr!���r"���Z_msvc9_suppress_errorsZdistutils.msvc9compilerr���r���r���r-���r1���r&���r8���rM���rc���r$���r���r���r���r����<module>���s>��� + /& %[���b