Current File : //proc/self/root/lib/python3/dist-packages/setuptools/__pycache__/msvc.cpython-312.pyc
�


_�d����h�dZddlZddlmZddlmZmZddlmZm	Z	m
Z
mZddlm
Z
ddlZddlZddlZddlZddlZddlmZej*�dk(rddlZdd	lmZnGd
�d�Ze�Zd�Zd
�Zddddd�Zd�Zd�Zd�Zdd�ZGd�d�Z Gd�d�Z!Gd�d�Z"Gd�d�Z#y) 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)�open)�listdir�pathsep)�join�isfile�isdir�dirname)�CalledProcessError)�unique_everseen�Windows)�environc��eZdZdZdZdZdZy)�winregN)�__name__�
__module__�__qualname__�
HKEY_USERS�HKEY_CURRENT_USER�HKEY_LOCAL_MACHINE�HKEY_CLASSES_ROOT���1/usr/lib/python3/dist-packages/setuptools/msvc.pyrr s���
� ��!�� �rrc�2�	tjtjddtjtjz�}d}d}|5t
j�D]e}	tj||�\}}}|s�!|tjk(s�5t|�s�A	tt|��}|dk\s�\||kDs�b||}}�gddd�||fS#t
$rYywxYw#t
$rY�'wxYw#ttf$rY��wxYw#1swY||fSxYw)�0Python 3.8 "distutils/_msvccompiler.py" backportz'Software\Microsoft\VisualStudio\SxS\VC7r�NNN�)r�OpenKeyr�KEY_READ�KEY_WOW64_32KEY�OSError�	itertools�count�	EnumValue�REG_SZr�int�float�
ValueError�	TypeError)�key�best_version�best_dir�i�v�vc_dir�vt�versions        r�_msvc14_find_vc2015r2)s"����n�n��%�%�6�
��O�O�f�4�4�4�	
���L��H�	�=����"�	=�A�
� &� 0� 0��a� 8�
��6�2��R�6�=�=�(�U�6�]��!�%��(�m�G��b�=�W�|�%;�-4�f�(�L�	=�=���!�!��%������
��
��
#�I�.�����=���!�!�s~�AC�
D
�&C%�D
�D
�D
�$C5�8D
�>D
�D
�	C"�!C"�%	C2�.D
�1C2�2D
�5D�D
�D�D
�
Dc
���tjd�xstjd�}|syd}|D]�}tjtt
t�5tjt|ddd�dd	d
|ddd
dg	�jdd��j�}t|ddd�}t|�rd|fcddd�cS	ddd���y#1swY��xYw)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 Studio�	Installerzvswhere.exez-latestz-prereleasez	-requiresz	-property�installationPathz	-products�*�mbcs�strict)�encoding�errors�VC�	Auxiliary�Build�N)
r
�get�
contextlib�suppressr
r!�UnicodeDecodeError�
subprocess�check_outputr�decode�stripr)�root�suitable_components�	component�paths    r�_msvc14_find_vc2017rMGs����;�;�*�+�J�w�{�{�>�/J�D�����
)� �	�
�
 �
 �!3�W�>P�
Q�	 ��'�'�� �";�[�-��"�%�#�!�#�*�#���������9����#
�(��d�K��9�D��T�{��4�x�/	 �	 �,�-	 �	 � �6�3	 �	 �s
�A&C�C!	�x86�x64�arm�arm64)rN�	x86_amd64�x86_arm�	x86_arm64c��t�\}}d}|tvr
t|}nd|vrdnd}|r.t|ddddd|d	d
�	}	ddl}|j|d�
�d}|st�\}}|rt|d|dd
�}|syt|d�}t|�sy|rt|�sd}||fS#tt
tf$rd}Y�fwxYw)rN�amd64rOrNz..�redist�MSVCz**zMicrosoft.VC14*.CRTzvcruntime140.dllrT)�	recursive���zMicrosoft.VC140.CRTrz
vcvarsall.bat)	rM�PLAT_SPEC_TO_RUNTIMEr�glob�ImportErrorr!�LookupErrorr2r)	�	plat_spec�_r,�	vcruntime�vcruntime_plat�vcredistr\r+�	vcvarsalls	         r�_msvc14_find_vcvarsallre�s���%�'�K�A�x��I��(�(�-�i�8��")�Y�"6��E�����������!��

��	���	�	�(�d�	�;�B�?�I��!4�!6���h������%�"��I����X��/�I��)����F�9�-��	��i����1�W�k�2�	��I�	�s�B(�(C�Cc��dtvr6tj�D��cic]\}}|j�|��c}}St|�\}}|stj
j
d��	tjdj||�tj��jdd��}d
�|j�D�D���cic]\}}}|r|r|j�|��}}}}|r||d<|Scc}}w#tj$r>}tj
j
dj|j��|�d	}~wwxYwcc}}}w)r�DISTUTILS_USE_SDKzUnable to find vcvarsall.batzcmd /u /c "{}" {} && set)�stderrzutf-16le�replace)r<zError executing {}Nc3�>K�|]}|jd����y�w)�=N)�	partition)�.0�lines  r�	<genexpr>z%_msvc14_get_vc_env.<locals>.<genexpr>�s����O�d�d�n�n�S�1�O�s��py_vcruntime_redist)r
�items�lowerre�	distutilsr<�DistutilsPlatformErrorrErF�format�STDOUTrGr
�cmd�
splitlines)	r_r*�valuerdra�out�excr`�envs	         r�_msvc14_get_vc_envr}�sG���g�%�5<�]�]�_�E�z�s�E��	�	��U�"�E�E�1�)�<��I�y�����5�5�6T�U�U���%�%�&�-�-�i��C��$�$�
��&��I�&�
.�	�P�c�n�n�>N�O����C��E��5�	�	�	��U���C���%.��!�"��J��1F���(�(�����5�5� �'�'����0�
��	����
s$�C=�/AD� E�E�9E�Ec�~�	t|�S#tjj$r}t	|d��d}~wwxYw)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)r}rsr<rt�_augment_exception)r_r{s  r�msvc14_get_vc_envr��s;��&�!�)�,�,�����2�2���3��%�
���s�

�<�
7�<c�V�|jd}d|j�vsd|j�vrnd}|jdit���}d}|dk(r.|j�j	d�dkDr|d	z
}n#|d
z
}n|dk(r|dz
}||d
zz
}n
|dk\r|dz
}|f|_y)zl
    Add details to the exception message to help guide the user
    as to what action will resolve it.
    rrdzvisual cz;Microsoft Visual C++ {version:0.1f} or greater is required.z-www.microsoft.com/download/details.aspx?id=%d�"@�ia64rZz( 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 rzd Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/Nr)�argsrrru�locals�find)r{r1�arch�message�tmpl�
msdownloads      rr�r��s����h�h�q�k�G��g�m�m�o�%��w�}�}��)F�L���$�+�+�)���)��D�
��c�>��z�z�|� � ��(�2�-��E�E��
�B�B��
��_��C�C�G��z�D�(�(�G�
��_��,�
�G��z�C�Hrc��eZdZdZej
dd�j
�Zd�Ze	d��Z
d�Zd�Zdd�Z
dd	�Zd
d
�Zy)�PlatformInfoz�
    Current and Target Architectures information.

    Parameters
    ----------
    arch: str
        Target architecture.
    �processor_architecture�c�N�|j�jdd�|_y)NrOrV)rrrir�)�selfr�s  r�__init__zPlatformInfo.__init__"s���J�J�L�(�(���8��	rc�X�|j|jjd�dzdS)zs
        Return Target CPU architecture.

        Return
        ------
        str
            Target CPU
        r`�N)r�r��r�s r�
target_cpuzPlatformInfo.target_cpu%s(���y�y�������,�q�0�2�3�3rc� �|jdk(S)z�
        Return True if target CPU is x86 32 bits..

        Return
        ------
        bool
            CPU is x86 32 bits
        rN�r�r�s r�
target_is_x86zPlatformInfo.target_is_x861s�����%�'�'rc� �|jdk(S)z�
        Return True if current CPU is x86 32 bits..

        Return
        ------
        bool
            CPU is x86 32 bits
        rN��current_cpur�s r�current_is_x86zPlatformInfo.current_is_x86<s�����5�(�(rc�l�|jdk(r|rdS|jdk(r|rdSd|jzS)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)
        rNr�rV�\x64�\%sr��r��hidex86rOs   r�current_dirzPlatformInfo.current_dirGsO��$� � �E�)�g�
�	
�� � �G�+���	
�
�$�*�*�*�	
rc�l�|jdk(r|rdS|jdk(r|rdSd|jzS)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)
        rNr�rVr�r�r�r�s   r�
target_dirzPlatformInfo.target_dir_sI��$���5�(�W�
�	
����7�*�s��	
�
�$�/�/�)�	
rc��|rdn|j}|j|k(rdS|j�jdd|z�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.
        rNr��\z\%s_)r�r�r�ri)r��forcex86�currents   r�	cross_dirzPlatformInfo.cross_dirwsN�� $�%��)9�)9�����'�)�
�	
����"�*�*�4��7�1B�C�	
rN)FF�F)rrr�__doc__r
rArrr�r��propertyr�r�r�r�r�r�rrrr�r�sW����'�+�+�6��;�A�A�C�K�9��	4��	4�	(�	)�
�0
�0
rr�c��eZdZdZej
ejejejfZ	d�Z
ed��Zed��Z
ed��Zed��Zed��Zed��Zed	��Zed
��Zed��Zdd�Zd
�Zy)�RegistryInfoz�
    Microsoft Visual Studio related registry information.

    Parameters
    ----------
    platform_info: PlatformInfo
        "PlatformInfo" instance.
    c��||_y�N)�pi)r��
platform_infos  rr�zRegistryInfo.__init__�s	����rc��y)z�
        Microsoft Visual Studio root registry key.

        Return
        ------
        str
            Registry key
        �VisualStudiorr�s r�visualstudiozRegistryInfo.visualstudio�s��rc�.�t|jd�S)z
        Microsoft Visual Studio SxS registry key.

        Return
        ------
        str
            Registry key
        �SxS)rr�r�s r�sxszRegistryInfo.sxs�s���D�%�%�u�-�-rc�.�t|jd�S)z|
        Microsoft Visual C++ VC7 registry key.

        Return
        ------
        str
            Registry key
        �VC7�rr�r�s r�vczRegistryInfo.vc�����D�H�H�e�$�$rc�.�t|jd�S)z
        Microsoft Visual Studio VS7 registry key.

        Return
        ------
        str
            Registry key
        �VS7r�r�s r�vszRegistryInfo.vs�r�rc��y)z�
        Microsoft Visual C++ for Python registry key.

        Return
        ------
        str
            Registry key
        zDevDiv\VCForPythonrr�s r�
vc_for_pythonzRegistryInfo.vc_for_python�s��%rc��y)zq
        Microsoft SDK registry key.

        Return
        ------
        str
            Registry key
        zMicrosoft SDKsrr�s r�
microsoft_sdkzRegistryInfo.microsoft_sdk�s�� rc�.�t|jd�S)z�
        Microsoft Windows/Platform SDK registry key.

        Return
        ------
        str
            Registry key
        r�rr�r�s r�windows_sdkzRegistryInfo.windows_sdk�s���D�&�&�	�2�2rc�.�t|jd�S)z�
        Microsoft .NET Framework SDK registry key.

        Return
        ------
        str
            Registry key
        �NETFXSDKr�r�s r�	netfx_sdkzRegistryInfo.netfx_sdk�s���D�&�&�
�3�3rc��y)z�
        Microsoft Windows Kits Roots registry key.

        Return
        ------
        str
            Registry key
        zWindows Kits\Installed Rootsrr�s r�windows_kits_rootszRegistryInfo.windows_kits_rootss��/rc�^�|jj�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
        r��Wow6432Node�Software�	Microsoft)r�r�r)r�r*rN�node64s    r�	microsoftzRegistryInfo.microsofts-�� �w�w�-�-�/�3��M���J���S�9�9rc	�0�tj}tj}tj}|j}|j
D]>}d}	||||�d|�}	tj||�d|r||�cScSy#ttf$rI|jj�s*	||||d�d|�}n#ttf$rYY��wxYwY��Y��wxYw#ttf$rYnwxYw	|s��||���#|r	||�wwxYw)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)rrr�CloseKeyr��HKEYSr!�IOErrorr�r��QueryValueEx)	r�r*�name�key_read�openkey�closekey�ms�hkey�bkeys	         r�lookupzRegistryInfo.lookup"s�� �?�?���.�.���?�?��
�^�^���J�J�	#�D��D�	
��t�R��W�a��:��
#��*�*�4��6�q�9���T�N��#	#���W�%�
��w�w�-�-�/�!�&�t�R��T�]�A�x�H���#�W�-�!� �!���	�
���W�%�
��
�����T�N����T�N��sZ�B�!C&�)C#�5C�C#�C�C#�C�C#�"C#�&C8�5D�7C8�8D�
DNr�)rrrr�rrrrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrr�r��s����	���� � ��!�!�� � �	
�E� ��	��	��	.��	.��	%��	%��	%��	%��	%��	%��	 ��	 ��	3��	3��	4��	4��	/��	/�:�&&#rr�c��eZdZdZej
dd�Zej
dd�Zej
de�Zdd�Z	d�Z
d	�Zd
�Ze
d��Zed��Zed
��Zd�Zd�Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Z d�Z!e
d d��Z"y)!�
SystemInfoz�
    Microsoft Windows and Visual Studio related system information.

    Parameters
    ----------
    registry_info: RegistryInfo
        "RegistryInfo" instance.
    vc_ver: float
        Required Microsoft Visual C++ version.
    �WinDirr�r5r4Nc��||_|jj|_|j�|_|xs|j	�x|_|_yr�)�rir��find_programdata_vs_vers�known_vs_paths�_find_latest_available_vs_ver�vs_ver�vc_ver)r��
registry_infor�s   rr�zSystemInfo.__init__]sG������'�'�*�*���"�;�;�=���%+�$R�d�.P�.P�.R�R���d�krc���|j�}|s+|jstjj	d��t|�}|j
|j�t|�dS)zm
        Find the latest VC version

        Return
        ------
        float
            version
        z%No Microsoft Visual C++ version foundrZ)�find_reg_vs_versr�rsr<rt�set�update�sorted)r��reg_vc_vers�vc_verss   rr�z(SystemInfo._find_latest_available_vs_verfsf���+�+�-���t�2�2��"�"�9�9�7��
��k�"�����t�*�*�+��g��r�"�"rc
���|jj}|jj|jj|jjf}g}tj|jj|�D�]'\}}	tj|||�dtj�}|5tj|�\}}}	t|�D][}
tj t"�5t%tj&||
�d�}||vr|j)|�ddd��]t|�D]X}
tj t"�5t%tj*||
��}||vr|j)|�ddd��Z	ddd���*t-|�S#ttf$rY��HwxYw#1swY��xYw#1swY��xYw#1swY��nxYw)z�
        Find Microsoft Visual Studio versions available in registry.

        Return
        ------
        list of float
            Versions
        rN)r�r�r�r�r�r"�productr�rrrr!r��QueryInfoKey�rangerBrCr(r'r$�append�EnumKeyr�)r�r��vckeys�vs_versr�r*r��subkeys�valuesr`r-�vers            rr�zSystemInfo.find_reg_vs_verszs����W�W�
�
���'�'�*�*�d�g�g�3�3�T�W�W�Z�Z�@����"�*�*�4�7�7�=�=�&�A�	0�I�D�#�
��~�~�d�B�s�G�Q����H���
0�%+�%8�%8��%>�"�����v��0�A�#�,�,�Z�8�0�#�F�$4�$4�T�1�$=�a�$@�A���g�-�#�N�N�3�/�0�0�0�
�w��0�A�#�,�,�Z�8�0�#�F�N�N�4��$;�<���g�-�#�N�N�3�/�0�0�0�
0�
0�	0�"�g�����W�%�
��
��
0�0��
0�0��
0�
0�sO�,F:�:AG(�;8G	�31G(�$5G	�
G(�:G
�G
�G
�G(�G%
�!G(�(G2	c��i}d}	t|�}|D]m}	t||d�}t	|dd��5}tj|�}ddd�d}tt|d��|||j|d	�<�o|S#ttf$r|cYSwxYw#1swY�UxYw#tttf$rY��wxYw)
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.json�rtzutf-8)r;Nr7�
VC\Tools\MSVC�installationVersion)	rr!r�rr�json�load�_as_float_version�KeyError)	r��vs_versions�
instances_dir�hashed_namesr��
state_path�
state_file�state�vs_paths	         rr�z#SystemInfo.find_programdata_vs_vers�s�����T�
�	�"�=�1�L�!�	�D�
�!�-��|�D�
��*�d�W�=�2�� �I�I�j�1�E�2�� 2�3����W�&6�7�8�
���*�*�5�1F�+G�H��	�(���1��!�	���	��2�2���W�h�/�
��
�s9�B�B(�B�9B(�B�B�B%	�!B(�(B?�>B?c�Z�tdj|jd�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)r1s rrzSystemInfo._as_float_version�s(���S�X�X�g�m�m�C�0��!�4�5�6�6rc���t|jd|jz�}|jj	|jj
d|jz�xs|S)zp
        Microsoft Visual Studio directory.

        Return
        ------
        str
            path
        zMicrosoft Visual Studio %0.1f�%0.1f)r�ProgramFilesx86r�r�r�r�)r��defaults  r�VSInstallDirzSystemInfo.VSInstallDir�sP���� � �"A�D�K�K�"O�
��
�w�w�~�~�d�g�g�j�j�'�D�K�K�*?�@�K�G�Krc��|j�xs|j�}t|�s!d}tjj|��|S)zm
        Microsoft Visual C++ directory.

        Return
        ------
        str
            path
        z(Microsoft Visual C++ directory not found)�	_guess_vc�_guess_vc_legacyrrsr<rt)r�rL�msgs   r�VCInstallDirzSystemInfo.VCInstallDir�sF���~�~��:�4�#8�#8�#:���T�{�<�C��"�"�9�9�#�>�>��rc�:�|jdkry	|j|j}t	|d�}	t|�d}|j
|�|_t	||�S#t$r|j}Y�TwxYw#tttf$rYywxYw)zl
        Locate Visual C++ for VS2017+.

        Return
        ------
        str
            path
        rr�rrZ)r�r�rrrrrr�r!r��
IndexError)r��vs_dir�guess_vcr�s    rrzSystemInfo._guess_vc�s����;�;�$���	'��(�(����5�F�
�� 0�1��	��X�&�r�*�F��0�0��8�D�K���&�)�)���	'��&�&�F�	'����*�-�	��	�s"�A(�/B�(B�?B�B�Bc�|�t|jd|jz�}t|jjd|jz�}|jj|d�}|rt|d�n|}|jj|jjd|jz�xs|S)z{
        Locate Visual C++ for versions prior to 2017.

        Return
        ------
        str
            path
        z Microsoft Visual Studio %0.1f\VCr�
installdirr=)rrr�r�r�r�r�)r�r�reg_path�	python_vc�
default_vcs     rrzSystemInfo._guess_vc_legacys����� � �"E����"S�
��
����-�-�w����/D�E���G�G�N�N�8�\�:�	�.7�T�)�T�*�W�
��w�w�~�~�d�g�g�j�j�'�D�K�K�*?�@�N�J�Nrc��|jdkry|jdk(ry|jdk(ry|jdk(ry|jd	k\ry
y)z�
        Microsoft Windows SDK versions for specified MSVC++ version.

        Return
        ------
        tuple of str
            versions
        r�)z7.0z6.1z6.0ar�)z7.1z7.0a�&@)z8.0z8.0a�(@)�8.1z8.1ar)z10.0r(N�r�r�s r�WindowsSdkVersionzSystemInfo.WindowsSdkVersion+sT���;�;�#��'�
�[�[�D�
 � �
�[�[�D�
 � �
�[�[�D�
 � �
�[�[�D�
 � �!rc�L�|jt|jd��S)zt
        Microsoft Windows SDK last version.

        Return
        ------
        str
            version
        �lib)�_use_last_dir_namer�
WindowsSdkDirr�s r�WindowsSdkLastVersionz SystemInfo.WindowsSdkLastVersion@s"���&�&�t�D�,>�,>��'F�G�Grc���d}|jD]E}t|jjd|z�}|jj	|d�}|s�En|rt|�sWt|jjd|jz�}|jj	|d�}|rt|d�}|rt|�sN|jD]?}|d|jd�}d	|z}t|j|�}t|�s�>|}�A|rt|�s:|jD]+}d
|z}t|j|�}t|�s�*|}�-|st|jd�}|S)zn
        Microsoft Windows SDK directory.

        Return
        ------
        str
            path
        r�zv%s�installationfolderrr!�WinSDKNrzMicrosoft SDKs\Windows Kits\%szMicrosoft SDKs\Windows\v%s�PlatformSDK)r*rr�r�r�rr�r��rfindr5r)r��sdkdirr��locrL�install_base�intver�ds        rr.zSystemInfo.WindowsSdkDirLs_�����)�)�	�C��t�w�w�*�*�E�C�K�8�C��W�W�^�^�C�)=�>�F���	��U�6�]�����-�-�w����/D�E�D��7�7�>�>�$��=�L���l�H�5���U�6�]��-�-�
���-�s�y�y��~�.��8�6�A����*�*�D�1����8��F�
��U�6�]��-�-�
��4�s�:����*�*�D�1����8��F�	
�
��$�+�+�]�;�F��
rc��|jdkrd}d}n2d}|jdkrdnd}|jjd|��}d	||jd
d�fz}g}|jdk\r6|jD]'}|t|jj||�gz
}�)|jD]*}|t|jjd
|z|�gz
}�,|D]$}|jj|d�}|s�"|cSy)zy
        Microsoft Windows SDK executable directory.

        Return
        ------
        str
            path
        r&�#r��(r'TF)rOr�zWinSDK-NetFx%dTools%sr��-rzv%sAr1N)r�r�r�ri�NetFxSdkVersionrr�r�r*r�r�)	r��netfxverr�r��fx�regpathsr�rL�execpaths	         r�WindowsSDKExecutablePathz#SystemInfo.WindowsSDKExecutablePathws���;�;�$���H��D��H�"�k�k�T�1�d�u�G��7�7�&�&�4��&�A�D�
$��$�,�,�t�S�2I�'J�
J�����;�;�$���+�+�
?���T�$�'�'�"3�"3�S�"�=�>�>��
?��)�)�	F�C���d�g�g�1�1�6�C�<��D�E�E�H�	F��	 �D��w�w�~�~�d�,@�A�H����	 rc��t|jjd|jz�}|jj	|d�xsdS)zl
        Microsoft Visual F# directory.

        Return
        ------
        str
            path
        z%0.1f\Setup\F#�
productdirr�)rr�r�r�r�)r�rLs  r�FSharpInstallDirzSystemInfo.FSharpInstallDir�s>���D�G�G�(�(�*;�d�k�k�*I�J���w�w�~�~�d�L�1�7�R�7rc��|jdk\rdnd}|D]?}|jj|jjd|z�}|s�9|xsdcSy)zt
        Microsoft Universal CRT SDK directory.

        Return
        ------
        str
            path
        r)�10�81rz
kitsroot%sr�N)r�r�r�r�)r��versr�r5s    r�UniversalCRTSdkDirzSystemInfo.UniversalCRTSdkDir�sW�� $�{�{�d�2�|����	$�C��W�W�^�^�D�G�G�$>�$>��s�@R�S�F���|��#�	$rc�L�|jt|jd��S)z�
        Microsoft Universal C Runtime SDK last version.

        Return
        ------
        str
            version
        r,)r-rrKr�s r�UniversalCRTSdkLastVersionz%SystemInfo.UniversalCRTSdkLastVersion�s"���&�&�t�D�,C�,C�U�'K�L�Lrc�(�|jdk\rdSdS)z�
        Microsoft .NET Framework SDK versions.

        Return
        ------
        tuple of str
            versions
        r)	z4.7.2z4.7.1z4.7z4.6.2z4.6.1z4.6z4.5.2z4.5.1z4.5rr)r�s rr>zSystemInfo.NetFxSdkVersion�s%���{�{�d�"�
X�	
��	
rc��d}|jD]C}t|jj|�}|jj	|d�}|s�B|S|S)zu
        Microsoft .NET Framework SDK directory.

        Return
        ------
        str
            path
        r��kitsinstallationfolder)r>rr�r�r�)r�r5r�r6s    r�NetFxSdkDirzSystemInfo.NetFxSdkDir�s[�����'�'�	�C��t�w�w�(�(�#�.�C��W�W�^�^�C�)A�B�F����
�	�
�
rc��t|jd�}|jj|jjd�xs|S)zw
        Microsoft .NET Framework 32bit directory.

        Return
        ------
        str
            path
        zMicrosoft.NET\Framework�frameworkdir32�rr�r�r�r��r��guess_fws  r�FrameworkDir32zSystemInfo.FrameworkDir32�s:������%?�@���w�w�~�~�d�g�g�j�j�*:�;�G�x�Grc��t|jd�}|jj|jjd�xs|S)zw
        Microsoft .NET Framework 64bit directory.

        Return
        ------
        str
            path
        zMicrosoft.NET\Framework64�frameworkdir64rTrUs  r�FrameworkDir64zSystemInfo.FrameworkDir64�s:������%A�B���w�w�~�~�d�g�g�j�j�*:�;�G�x�Grc�$�|jd�S)z�
        Microsoft .NET Framework 32bit versions.

        Return
        ------
        tuple of str
            versions
        � ��_find_dot_net_versionsr�s r�FrameworkVersion32zSystemInfo.FrameworkVersion32	����*�*�2�.�.rc�$�|jd�S)z�
        Microsoft .NET Framework 64bit versions.

        Return
        ------
        tuple of str
            versions
        �@r]r�s r�FrameworkVersion64zSystemInfo.FrameworkVersion64r`rc�|�|jj|jjd|z�}t|d|z�}|xs|j	|d�xsd}|j
dk\r|dfS|j
dk\r|j
�dd	d
k7rddfS|dfS|j
d
k(ry|j
dk(ryy)z�
        Find Microsoft .NET Framework versions.

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

        Return
        ------
        tuple of str
            versions
        zframeworkver%dzFrameworkDir%dr.r�r'zv4.0r�Nr�v4z
v4.0.30319�v3.5r�)rf�
v2.0.50727g @)zv3.0rg)r�r�r��getattrr-r�rr)r��bits�reg_ver�dot_net_dirr�s     rr^z!SystemInfo._find_dot_net_versions!s����'�'�.�.������-=��-D�E���d�$4�t�$;�<���H��0�0��c�B�H�b���;�;�$����;��
�[�[�D�
 �#&�9�9�;�r��?�d�#:�<�V�K�K��V�K�K�
�[�[�C�
�'�
�[�[�C�
�'� rc�b�����fd�tt���D�}t|d�xsdS)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
        c3�n�K�|],}tt�|��r|j��r|���.y�wr�)rr�
startswith)rm�dir_namerL�prefixs  ��rroz0SystemInfo._use_last_dir_name.<locals>.<genexpr>Os5�����
���T�$��)�*�x�/B�/B�6�/J�
�
�s�25Nr�)�reversedr�next)rLrp�
matching_dirss`` rr-zSystemInfo._use_last_dir_name>s/���"
�$�W�T�]�3�
�
�
�M�4�(�.�B�.rr��r�)#rrrr�r
rAr�r5rr�r�r�r��staticmethodrr�rrrrr*r/r.rCrFrKrMr>rQrWrZr_rcr^r-rrrr�r�Ks���	��W�[�[��2�
&�F��7�;�;�~�r�2�L�!�g�k�k�"5�|�D�O�S�#�(�>(�T�7��7� �L��L�"����"�<O�*�!��!�(�	H��	H��(��(�T�  ��  �D�
8��
8��$��$�$�	M��	M��
��
� ����"�
H��
H��
H��
H��	/��	/��	/��	/�(�:�/��/rr�c��eZdZdZdd�Zed��Zed��Zed��Zed��Z	ed��Z
ed	��Zed
��Zed��Z
ed��Zed
��Zed��Zd�Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zd d�Zd�Z y)!�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.
    Nc���t|�|_t|j�|_t	|j|�|_|j|kr!d}tjj|��y)Nz.No suitable Microsoft Visual C++ version found)
r�r�r�r�r��sir�rsr<rt)r�r�r��
vc_min_ver�errs     rr�zEnvironmentInfo.__init__os]���t�$����t�w�w�'����T�W�W�f�-����;�;��#�B�C��"�"�9�9�#�>�>�$rc�.�|jjS)zk
        Microsoft Visual Studio.

        Return
        ------
        float
            version
        )ryr�r�s rr�zEnvironmentInfo.vs_verx����w�w�~�~�rc�.�|jjS)zp
        Microsoft Visual C++ version.

        Return
        ------
        float
            version
        )ryr�r�s rr�zEnvironmentInfo.vc_ver�r}rc���ddg}|jdk\r2|jjdd��}|dgz
}|dgz
}|d|zgz
}|D�cgc]"}t|jj
|���$c}Scc}w)	zu
        Microsoft Visual Studio Tools.

        Return
        ------
        list of str
            paths
        zCommon7\IDEz
Common7\ToolsrT�r�rOz1Common7\IDE\CommonExtensions\Microsoft\TestWindowzTeam Tools\Performance ToolszTeam Tools\Performance Tools%s)r�r�r�rryr)r��paths�arch_subdirrLs    r�VSToolszEnvironmentInfo.VSTools�s��� �!1�2���;�;�$���'�'�-�-�d��-�E�K��J�K�K�E��5�6�6�E��7�+�E�F�F�E�=B�C�T��T�W�W�)�)�4�0�C�C��Cs�
'A4c��t|jjd�t|jjd�gS)z�
        Microsoft Visual C++ & Microsoft Foundation Class Includes.

        Return
        ------
        list of str
            paths
        �IncludezATLMFC\Include)rryrr�s r�
VCIncludeszEnvironmentInfo.VCIncludes�s7��
����%�%�y�1�����%�%�'8�9�
�	
rc�<�|jdk\r|jjd��}n|jjd��}d|zd|zg}|jdk\r	|d|zgz
}|D�cgc]"}t|jj
|���$c}Scc}w)	z�
        Microsoft Visual C++ & Microsoft Foundation Class Libraries.

        Return
        ------
        list of str
            paths
        �.@T�rO�r��Lib%szATLMFC\Lib%srzLib\store%s)r�r�r�rryr)r�r�r�rLs    r�VCLibrarieszEnvironmentInfo.VCLibraries�s����;�;�$���'�'�,�,��,�6�K��'�'�,�,�T�,�:�K��;�&��+�(E�F���;�;�$���n�{�2�3�3�E�=B�C�T��T�W�W�)�)�4�0�C�C��Cs�/'Bc�f�|jdkrgSt|jjd�gS)z�
        Microsoft Visual C++ store references Libraries.

        Return
        ------
        list of str
            paths
        rzLib\store\references)r�rryrr�s r�VCStoreRefszEnvironmentInfo.VCStoreRefs�s0���;�;����I��T�W�W�)�)�+B�C�D�Drc�B�|j}t|jd�g}|jdkrdnd}|jj|�}|r|t|jd|z�gz
}|jdk(r;d|jj
d��z}|t|j|�gz
}|S|jdk\r�|jj�rd	nd
}|t|j||jjd��z�gz
}|jj|jjk7r7|t|j||jj
d��z�gz
}|S|t|jd�gz
}|S)
zr
        Microsoft Visual C++ Tools.

        Return
        ------
        list of str
            paths
        �
VCPackagesr�TF�Bin%srr�r�z
bin\HostX86%sz
bin\HostX64%sr��Bin)ryrrr�r�r�r�r�r�r�r�)r�ry�toolsr�r�rL�host_dirs       r�VCToolszEnvironmentInfo.VCTools�s}���W�W���b�o�o�|�4�5���;�;�$�.�4�E���g�g�'�'��1����d�2�?�?�G�k�,A�B�C�C�E��;�;�$���T�W�W�0�0��0�>�>�D��d�2�?�?�D�1�2�2�E� ���[�[�D�
 �$(�G�G�$:�$:�$<� �BR�
�
�d�2�?�?�H�t�w�w�7I�7I�d�7I�7S�,S�T�U�U�E��w�w�"�"�d�g�g�&8�&8�8������(�T�W�W�5H�5H�T�5H�5R�*R�S������
�d�2�?�?�E�2�3�3�E��rc�V�|jdkrA|jjdd��}t|jj
d|z�gS|jjd��}t|jj
d�}|j}t||�d|���gS)zw
        Microsoft Windows SDK Libraries.

        Return
        ------
        list of str
            paths
        r�Tr�r�r�r,�um)r�r�r�rryr.�_sdk_subdir)r�r�r,�libvers    r�OSLibrarieszEnvironmentInfo.OSLibraries�s����;�;�$���'�'�,�,�T�t�,�D�K�����.�.��+�0E�F�G�G��'�'�,�,��,�6�K��t�w�w�,�,�e�4�C��%�%�F���&�+�>�?�@�@rc��t|jjd�}|jdkr|t|d�gS|jdk\r
|j}nd}t|d|z�t|d|z�t|d|z�gS)	zu
        Microsoft Windows SDK Include.

        Return
        ------
        list of str
            paths
        �includer��glrr�z%ssharedz%sumz%swinrt)rryr.r�r�)r�r��sdkvers   r�
OSIncludeszEnvironmentInfo.OSIncludess����t�w�w�,�,�i�8���;�;�$���T�'�4�0�1�1��{�{�d�"��)�)�����W�j�6�1�2��W�f�v�o�.��W�i�&�0�1��
rc���t|jjd�}g}|jdkr||jz
}|jdk\r|t|d�gz
}|jdk\rz||t|jjd�t|dd�t|d	d�t|d
d�t|jjddd
|jzddd�gz
}|S)z}
        Microsoft Windows SDK Libraries Paths.

        Return
        ------
        list of str
            paths
        �
Referencesr�r&zCommonConfiguration\Neutralr�
UnionMetadataz'Windows.Foundation.UniversalApiContractz1.0.0.0z%Windows.Foundation.FoundationContractz,Windows.Networking.Connectivity.WwanContract�
ExtensionSDKszMicrosoft.VCLibsr�CommonConfiguration�neutral)rryr.r�r�)r��ref�libpaths   r�	OSLibpathzEnvironmentInfo.OSLibpath*s����4�7�7�(�(�,�7�����;�;�#���t�'�'�'�G��;�;�$����S�"@�A�B�B�G��;�;�$�����T�W�W�*�*�O�<��S�C�Y�O��S�A�9�M��S�H�)�T���G�G�)�)�#�&��d�k�k�)� �)���
�
�G� �rc�4�t|j��S)zs
        Microsoft Windows SDK Tools.

        Return
        ------
        list of str
            paths
        )�list�
_sdk_toolsr�s r�SdkToolszEnvironmentInfo.SdkToolsPs���D�O�O�%�&�&rc#�rK�|jdkr5|jdkrdnd}t|jj|���|jj�sC|jj
d��}d|z}t|jj|���|jdvrb|jj�rd	}n|jj
dd�
�}d|z}t|jj|���ns|jdk\rdt|jjd�}|jj
d��}|jj}t||�|�����|jjr|jj��yy�w)
z�
        Microsoft Windows SDK Tools paths generator.

        Return
        ------
        generator of str
            paths
        r�r&r�zBin\x86Tr�r�)r�r&r�r�zBin\NETFX 4.0 Tools%sN)
r�rryr.r�r�r�r�r/rC)r��bin_dirr�rLr�s     rr�zEnvironmentInfo._sdk_tools\s\�����;�;���#�{�{�d�2�e�
�G��t�w�w�,�,�g�6�6��w�w�%�%�'��'�'�-�-�$�-�7�K��[�(�D��t�w�w�,�,�d�3�3��;�;�,�&��w�w�$�$�&� ��"�g�g�1�1�$�D�1�I��+�k�9�D��t�w�w�,�,�d�3�3�
�[�[�D�
 �����-�-�u�5�D��'�'�-�-�$�-�7�K��W�W�2�2�F��t�v�{�;�<�<��7�7�+�+��'�'�2�2�2�,�s�F5F7c�@�|jj}|rd|zSdS)zu
        Microsoft Windows SDK version subdir.

        Return
        ------
        str
            subdir
        �%s\r�)ryr/�r��ucrtvers  rr�zEnvironmentInfo._sdk_subdirs%���'�'�/�/��%,��� �4�"�4rc�f�|jdkDrgSt|jjd�gS)zs
        Microsoft Windows SDK Setup.

        Return
        ------
        list of str
            paths
        r��Setup)r�rryr.r�s r�SdkSetupzEnvironmentInfo.SdkSetup�s/���;�;����I��T�W�W�*�*�G�4�5�5rc�
�|j}|j}|jdkr'd}|j�xr|j	�}nB|j�xs|j	�}|j
dk(xs|jdk(}g}|r1||jD�cgc]}t|j|���c}z
}|r1||jD�cgc]}t|j|���c}z
}|Scc}wcc}w)zv
        Microsoft .NET Framework Tools.

        Return
        ------
        list of str
            paths
        r�TrV)r�ryr�r�r�r�r�r_rrWrcrZ)r�r�ry�	include32�	include64r�r�s       r�FxToolszEnvironmentInfo.FxTools�s����W�W��
�W�W���;�;�$���I��,�,�.�.�J�r�7H�7H�7J�3J�I��(�(�*�A�b�.?�.?�.A�I����'�1�M�R�]�]�g�5M�I�����b�>S�>S�T�s�d�2�,�,�c�2�T�T�E���b�>S�>S�T�s�d�2�,�,�c�2�T�T�E����U��Ts�$C;�Dc���|jdks|jjsgS|jj	d��}t|jjd|z�gS)z~
        Microsoft .Net Framework SDK Libraries.

        Return
        ------
        list of str
            paths
        rTr�zlib\um%s)r�ryrQr�r�r)r�r�s  r�NetFxSDKLibrariesz!EnvironmentInfo.NetFxSDKLibraries�sW���;�;���T�W�W�%8�%8��I��g�g�(�(�T�(�2���T�W�W�(�(�+��*C�D�E�Erc��|jdks|jjsgSt|jjd�gS)z}
        Microsoft .Net Framework SDK Includes.

        Return
        ------
        list of str
            paths
        rz
include\um)r�ryrQrr�s r�NetFxSDKIncludesz EnvironmentInfo.NetFxSDKIncludes�s;���;�;���T�W�W�%8�%8��I��T�W�W�(�(�-�8�9�9rc�D�t|jjd�gS)z�
        Microsoft Visual Studio Team System Database.

        Return
        ------
        list of str
            paths
        z
VSTSDB\Deploy)rryrr�s r�VsTDbzEnvironmentInfo.VsTDb�s���T�W�W�)�)�+;�<�=�=rc�X�|jdkrgS|jdkr3|jj}|jj	d��}n|jj
}d}d|j|fz}t
||�g}|jdk\r|t
||d�gz
}|S)zn
        Microsoft Build Engine.

        Return
        ------
        list of str
            paths
        r'r�Tr�r�zMSBuild\%0.1f\bin%s�Roslyn)r�ryrr�r�rr)r��	base_pathr�rL�builds     r�MSBuildzEnvironmentInfo.MSBuild�s����;�;����I�
�[�[�4�
����/�/�I��'�'�-�-�d�-�;�K����,�,�I��K�%����k�(B�B���i��&�'���;�;�$���d�9�d�H�5�6�6�E��rc�f�|jdkrgSt|jjd�gS)zt
        Microsoft HTML Help Workshop.

        Return
        ------
        list of str
            paths
        r&zHTML Help Workshop)r�rryrr�s r�HTMLHelpWorkshopz EnvironmentInfo.HTMLHelpWorkshop�s0���;�;����I��T�W�W�,�,�.B�C�D�Drc���|jdkrgS|jjd��}t|jj
d�}|j}t||�d|���gS)z�
        Microsoft Universal C Runtime SDK Libraries.

        Return
        ------
        list of str
            paths
        rTr�r,�ucrt)r�r�r�rryrK�_ucrt_subdir)r�r�r,r�s    r�
UCRTLibrarieszEnvironmentInfo.UCRTLibrariessb���;�;����I��g�g�(�(�T�(�2���4�7�7�-�-�u�5���#�#���S���=�>�?�?rc��|jdkrgSt|jjd�}t|d|jz�gS)z�
        Microsoft Universal C Runtime SDK Include.

        Return
        ------
        list of str
            paths
        rr�z%sucrt)r�rryrKr�)r�r�s  r�UCRTIncludeszEnvironmentInfo.UCRTIncludessF���;�;����I��t�w�w�1�1�9�=���W�h��):�):�:�;�<�<rc�@�|jj}|rd|zSdS)z�
        Microsoft Universal C Runtime SDK version subdir.

        Return
        ------
        str
            subdir
        r�r�)ryrMr�s  rr�zEnvironmentInfo._ucrt_subdir.s%���'�'�4�4��%,��� �4�"�4rc�`�d|jcxkDrdkDrgS|jjgS)zk
        Microsoft Visual F#.

        Return
        ------
        list of str
            paths
        r&r')r�ryrFr�s r�FSharpzEnvironmentInfo.FSharp;s4���$�+�+�$��$��I�%����(�(�)�)rc�6�d|jz}|jjd��jd�}g}|jj
}t
|jdd��}t|�r)t|t|�d�}||t|d�gz
}|t|d	�gz
}d
|jdzzd
t|j�dzzf}tj||�D]"\}}t||||�}	t|	�s� |	cSy)
z
        Microsoft Visual C++ runtime redistributable dll.

        Return
        ------
        str
            path
        zvcruntime%d0.dllTr�r�z\Toolsz\RedistrZ�onecorerWzMicrosoft.VC%d.CRT�
N)r�r�r�rHryrr	rirrrr&r�r"r�r)
r�rar��prefixes�
tools_path�redist_path�crt_dirsrp�crt_dirrLs
          r�VCRuntimeRedistzEnvironmentInfo.VCRuntimeRedistJs��'����4�	��g�g�(�(�T�(�2�8�8��>�����W�W�)�)�
��j�0�0��J�G�H������{�G�K�,@��,D�E�K���d�;�	�&B�C�C�H��T�*�h�/�0�0��
!�D�K�K�"�$4�5� �C����$4�r�$9�:�
�� )�0�0��8�D�	�O�F�G����W�i�@�D��d�|���	rc��t|jd|j|j|j|j
g|�|jd|j|j|j|j|jg|�|jd|j|j|j|jg|�|jd|j|j|j|j |j"|j|j$|j&|j(g	|���}|j*dk\r$t-|j.�r|j.|d<|S)z�
        Return environment dict.

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

        Return
        ------
        dict
            environment
        r�r,r�rL)r�r,r�rLrrp)�dict�_build_pathsr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�)r��existsr|s   r�
return_envzEnvironmentInfo.return_envosW����%�%���O�O��O�O��%�%��)�)�	��	��!�!���$�$��$�$��L�L��&�&��*�*���
��%�%���!�!�4�<�<��1A�1A�4�>�>�R���
�"�"���L�L��L�L��J�J��M�M��M�M��L�L��L�L��)�)��K�K�
���7*
��V�;�;�"����(<�(<�!=�)-�)=�)=�C�%�&��
rc��tjj|�}tj|d�jt�}tj||�}|rttt|��n|}|s2d|j�z}tjj|��t|�}	t
j|	�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
        r�z %s environment variable is empty)r"�chain�
from_iterabler
rArrr��filterr�upperrsr<rtrr)
r�r��spec_path_listsr��
spec_paths�	env_pathsr��extant_pathsr�unique_pathss
          rr�zEnvironmentInfo._build_paths�s���.�_�_�2�2�?�C�
��K�K��b�)�/�/��8�	����
�I�6��5;�t�F�5�%�0�1����4�t�z�z�|�C�C��"�"�9�9�#�>�>�&�|�4���|�|�L�)�)r)Nr)T)!rrrr�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�rrrrwrwWs���.?��	��	��	��	��D��D�&�
��
��D��D�(�E��E��#��#�J�A��A�&����2�#��#�J�	'��	'�!3�F�
5��
5��6��6�����4�
F��
F��:��:��	>��	>�����6�E��E��@��@�"�
=��
=��
5��
5��*��*��"��"�H;�z*rrwrt)$r�r�ior�osrr�os.pathrrrr	rEr
rB�platformr"�distutils.errorsrs� setuptools.extern.more_itertoolsr�systemrr
r�r2rMr[rer}r�r�r�r�r�rwrrr�<module>r�s�������0�0�)������<��8�?�?��	�!���!�!��f�G�"�<0�h����	��2 �j�<�4$�Nv
�v
�ry#�y#�xI/�I/�Xt	*�t	*r
¿Qué es la limpieza dental de perros? - Clínica veterinaria


Es la eliminación del sarro y la placa adherida a la superficie de los dientes mediante un equipo de ultrasonidos que garantiza la integridad de las piezas dentales a la vez que elimina en profundidad cualquier resto de suciedad.

A continuación se procede al pulido de los dientes mediante una fresa especial que elimina la placa bacteriana y devuelve a los dientes el aspecto sano que deben tener.

Una vez terminado todo el proceso, se mantiene al perro en observación hasta que se despierta de la anestesia, bajo la atenta supervisión de un veterinario.

¿Cada cuánto tiempo tengo que hacerle una limpieza dental a mi perro?

A partir de cierta edad, los perros pueden necesitar una limpieza dental anual o bianual. Depende de cada caso. En líneas generales, puede decirse que los perros de razas pequeñas suelen acumular más sarro y suelen necesitar una atención mayor en cuanto a higiene dental.


Riesgos de una mala higiene


Los riesgos más evidentes de una mala higiene dental en los perros son los siguientes:

  • Cuando la acumulación de sarro no se trata, se puede producir una inflamación y retracción de las encías que puede descalzar el diente y provocar caídas.
  • Mal aliento (halitosis).
  • Sarro perros
  • Puede ir a más
  • Las bacterias de la placa pueden trasladarse a través del torrente circulatorio a órganos vitales como el corazón ocasionando problemas de endocarditis en las válvulas. Las bacterias pueden incluso acantonarse en huesos (La osteomielitis es la infección ósea, tanto cortical como medular) provocando mucho dolor y una artritis séptica).

¿Cómo se forma el sarro?

El sarro es la calcificación de la placa dental. Los restos de alimentos, junto con las bacterias presentes en la boca, van a formar la placa bacteriana o placa dental. Si la placa no se retira, al mezclarse con la saliva y los minerales presentes en ella, reaccionará formando una costra. La placa se calcifica y se forma el sarro.

El sarro, cuando se forma, es de color blanquecino pero a medida que pasa el tiempo se va poniendo amarillo y luego marrón.

Síntomas de una pobre higiene dental
La señal más obvia de una mala salud dental canina es el mal aliento.

Sin embargo, a veces no es tan fácil de detectar
Y hay perros que no se dejan abrir la boca por su dueño. Por ejemplo…

Recientemente nos trajeron a la clínica a un perro que parpadeaba de un ojo y decía su dueño que le picaba un lado de la cara. Tenía molestias y dificultad para comer, lo que había llevado a sus dueños a comprarle comida blanda (que suele ser un poco más cara y llevar más contenido en grasa) durante medio año. Después de una exploración oftalmológica, nos dimos cuenta de que el ojo tenía una úlcera en la córnea probablemente de rascarse . Además, el canto lateral del ojo estaba inflamado. Tenía lo que en humanos llamamos flemón pero como era un perro de pelo largo, no se le notaba a simple vista. Al abrirle la boca nos llamó la atención el ver una muela llena de sarro. Le realizamos una radiografía y encontramos una fístula que llegaba hasta la parte inferior del ojo.

Le tuvimos que extraer la muela. Tras esto, el ojo se curó completamente con unos colirios y una lentilla protectora de úlcera. Afortunadamente, la úlcera no profundizó y no perforó el ojo. Ahora el perro come perfectamente a pesar de haber perdido una muela.

¿Cómo mantener la higiene dental de tu perro?
Hay varias maneras de prevenir problemas derivados de la salud dental de tu perro.

Limpiezas de dientes en casa
Es recomendable limpiar los dientes de tu perro semanal o diariamente si se puede. Existe una gran variedad de productos que se pueden utilizar:

Pastas de dientes.
Cepillos de dientes o dedales para el dedo índice, que hacen más fácil la limpieza.
Colutorios para echar en agua de bebida o directamente sobre el diente en líquido o en spray.

En la Clínica Tus Veterinarios enseñamos a nuestros clientes a tomar el hábito de limpiar los dientes de sus perros desde que son cachorros. Esto responde a nuestro compromiso con la prevención de enfermedades caninas.

Hoy en día tenemos muchos clientes que limpian los dientes todos los días a su mascota, y como resultado, se ahorran el dinero de hacer limpiezas dentales profesionales y consiguen una mejor salud de su perro.


Limpiezas dentales profesionales de perros y gatos

Recomendamos hacer una limpieza dental especializada anualmente. La realizamos con un aparato de ultrasonidos que utiliza agua para quitar el sarro. Después, procedemos a pulir los dientes con un cepillo de alta velocidad y una pasta especial. Hacemos esto para proteger el esmalte.

La frecuencia de limpiezas dentales necesaria varía mucho entre razas. En general, las razas grandes tienen buena calidad de esmalte, por lo que no necesitan hacerlo tan a menudo e incluso pueden pasarse la vida sin requerir una limpieza. Sin embargo, razas pequeñas como el Yorkshire o el Maltés, deben hacérselas todos los años desde cachorros si se quiere conservar sus piezas dentales.

Otro factor fundamental es la calidad del pienso. Algunas marcas han diseñado croquetas que limpian la superficie del diente y de la muela al masticarse.

Ultrasonido para perros

¿Se necesita anestesia para las limpiezas dentales de perros y gatos?

La limpieza dental en perros no es una técnica que pueda practicarse sin anestesia general , aunque hay veces que los propietarios no quieren anestesiar y si tiene poco sarro y el perro es muy bueno se puede intentar…… , pero no se va a poder pulir ni acceder a todas la zona de la boca …. Además los limpiadores dentales van a irrigar agua y hay riesgo de aspiración a vías respiratorias si no se realiza una anestesia correcta con intubación traqueal . En resumen , sin anestesia no se va hacer una correcta limpieza dental.

Tampoco sirve la sedación ya que necesitamos que el animal esté totalmente quieto, y el veterinario tenga un acceso completo a todas sus piezas dentales y encías.

Alimentos para la limpieza dental

Hay que tener cierto cuidado a la hora de comprar determinados alimentos porque no todos son saludables. Algunos tienen demasiado contenido graso, que en exceso puede causar problemas cardiovasculares y obesidad.

Los mejores alimentos para los dientes son aquellos que están elaborados por empresas farmacéuticas y llevan componentes químicos con tratamientos específicos para el diente del perro. Esto implica no solo limpieza a través de la acción mecánica de morder sino también un tratamiento antibacteriano para prevenir el sarro.

Conclusión

Si eres como la mayoría de dueños, por falta de tiempo , es probable que no estés prestando la suficiente atención a la limpieza dental de tu perro. Por eso te animamos a que comiences a limpiar los dientes de tu perro y consideres atender a su higiene bucal con frecuencia.

Estas simples medidas pueden conllevar a que tu perro tenga una vida más larga y mucho más saludable.

Si te resulta imposible introducir un cepillo de dientes a tu perro en la boca, pásate con él por clínica Tus Veterinarios y te explicamos cómo hacerlo.

Necesitas hacer una limpieza dental profesional a tu mascota?
Llámanos al 622575274 o contacta con nosotros

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

¡Hola!