HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/Python311/Lib/site-packages/pip/_vendor/platformdirs/__pycache__/windows.cpython-311.pyc
�

�mi�'����dZddlmZddlZddlZddlmZddlmZddl	m
Z
erddlmZGd	�d
e
��Z
dd�Zdd�Zdd�Zdd�Zdd�Zed���e����Zd
gZdS)zWindows.�)�annotationsN)�	lru_cache)�
TYPE_CHECKING�)�PlatformDirsABC)�Callablec��eZdZdZedd���Zdd�dd
�Zedd���Zedd���Zedd
���Z	edd���Z
edd���Zedd���Zedd���Z
edd���Zedd���Zedd���Zedd���Zedd���Zedd���Zedd���Zedd���ZdS)�Windowsa�
    `MSDN on where to store app data files <https://learn.microsoft.com/en-us/windows/win32/shell/knownfolderid>`_.

    Makes use of the `appname <platformdirs.api.PlatformDirsABC.appname>`, `appauthor
    <platformdirs.api.PlatformDirsABC.appauthor>`, `version <platformdirs.api.PlatformDirsABC.version>`, `roaming
    <platformdirs.api.PlatformDirsABC.roaming>`, `opinion <platformdirs.api.PlatformDirsABC.opinion>`, `ensure_exists
    <platformdirs.api.PlatformDirsABC.ensure_exists>`.

    �return�strc��|jrdnd}tj�t	|����}|�|��S)z�
        :return: data directory tied to the user, e.g.
         ``%USERPROFILE%\AppData\Local\$appauthor\$appname`` (not roaming) or
         ``%USERPROFILE%\AppData\Roaming\$appauthor\$appname`` (roaming)
        �
CSIDL_APPDATA�CSIDL_LOCAL_APPDATA)�roaming�os�path�normpath�get_win_folder�
_append_parts)�self�constrs   �BD:\Python311\Lib\site-packages\pip/_vendor/platformdirs/windows.py�
user_data_dirzWindows.user_data_dirsF��$(�<�J���5J���w����u� 5� 5�6�6���!�!�$�'�'�'�N��
opinion_valuerr�
str | Nonec�z�g}|jr�|jdur#|jp|j}|�|��|�|j��|�|jr|�|��|jr|�|j��tjj|g|�R�}|�|��|S)NF)	�appname�	appauthor�append�opinion�versionrr�join�_optionally_create_directory)rrr�params�authors     rrzWindows._append_parts&s������<�	,��~�U�*�
&���7�4�<���
�
�f�%�%�%��M�M�$�,�'�'�'��
-�T�\�
-��
�
�m�,�,�,��|�
,��
�
�d�l�+�+�+��w�|�D�*�6�*�*�*���)�)�$�/�/�/��rc��tj�td����}|�|��S)zT:return: data directory shared by users, e.g. ``C:\ProgramData\$appauthor\$appname``�CSIDL_COMMON_APPDATA�rrrrr�rrs  r�
site_data_dirzWindows.site_data_dir5s6���w����/E� F� F�G�G���!�!�$�'�'�'rc��|jS)zC:return: config directory tied to the user, same as `user_data_dir`�r�rs r�user_config_dirzWindows.user_config_dir;�
���!�!rc��|jS)zF:return: config directory shared by the users, same as `site_data_dir`)r,r/s r�site_config_dirzWindows.site_config_dir@r1rc��tj�td����}|�|d���S)z�
        :return: cache directory tied to the user (if opinionated with ``Cache`` folder within ``$appname``) e.g.
         ``%USERPROFILE%\AppData\Local\$appauthor\$appname\Cache\$version``
        r�Cacherr*r+s  r�user_cache_dirzWindows.user_cache_dirEs;���w����/D� E� E�F�F���!�!�$�g�!�>�>�>rc��tj�td����}|�|d���S)zd:return: cache directory shared by users, e.g. ``C:\ProgramData\$appauthor\$appname\Cache\$version``r)r5rr*r+s  r�site_cache_dirzWindows.site_cache_dirNs;���w����/E� F� F�G�G���!�!�$�g�!�>�>�>rc��|jS)zB:return: state directory tied to the user, same as `user_data_dir`r.r/s r�user_state_dirzWindows.user_state_dirTr1rc��|j}|jr5tj�|d��}|�|��|S)zg:return: log directory tied to the user, same as `user_data_dir` if not opinionated else ``Logs`` in it�Logs)rr"rrr$r%r+s  r�user_log_dirzWindows.user_log_dirYsD���!���<�	4��7�<�<��f�-�-�D��-�-�d�3�3�3��rc�Z�tj�td����S)zN:return: documents directory tied to the user e.g. ``%USERPROFILE%\Documents``�CSIDL_PERSONAL�rrrrr/s r�user_documents_dirzWindows.user_documents_dirbs#���w����/?� @� @�A�A�Arc�Z�tj�td����S)zN:return: downloads directory tied to the user e.g. ``%USERPROFILE%\Downloads``�CSIDL_DOWNLOADSr@r/s r�user_downloads_dirzWindows.user_downloads_dirgs#���w����/@� A� A�B�B�Brc�Z�tj�td����S)zL:return: pictures directory tied to the user e.g. ``%USERPROFILE%\Pictures``�CSIDL_MYPICTURESr@r/s r�user_pictures_dirzWindows.user_pictures_dirls#���w����/A� B� B�C�C�Crc�Z�tj�td����S)zH:return: videos directory tied to the user e.g. ``%USERPROFILE%\Videos``�
CSIDL_MYVIDEOr@r/s r�user_videos_dirzWindows.user_videos_dirq�"���w����� ?� ?�@�@�@rc�Z�tj�td����S)zF:return: music directory tied to the user e.g. ``%USERPROFILE%\Music``�
CSIDL_MYMUSICr@r/s r�user_music_dirzWindows.user_music_dirvrKrc�Z�tj�td����S)zK:return: desktop directory tied to the user, e.g. ``%USERPROFILE%\Desktop``�CSIDL_DESKTOPDIRECTORYr@r/s r�user_desktop_dirzWindows.user_desktop_dir{s#���w����/G� H� H�I�I�Irc��tj�tj�t	d��d����}|�|��S)z�
        :return: runtime directory tied to the user, e.g.
         ``%USERPROFILE%\AppData\Local\Temp\$appauthor\$appname``
        r�Temp)rrrr$rrr+s  r�user_runtime_dirzWindows.user_runtime_dir�sG���w�������^�<Q�-R�-R�TZ� [� [�\�\���!�!�$�'�'�'rc��|jS)zF:return: runtime directory shared by users, same as `user_runtime_dir`)rTr/s r�site_runtime_dirzWindows.site_runtime_dir�s
���$�$r)rr)rrrrrr)�__name__�
__module__�__qualname__�__doc__�propertyrrr,r0r3r6r8r:r=rArDrGrJrNrQrTrV�rrr
r
s[���������(�(�(��X�(�GK�
�
�
�
�
�
��(�(�(��X�(�
�"�"�"��X�"��"�"�"��X�"��?�?�?��X�?��?�?�?��X�?�
�"�"�"��X�"������X���B�B�B��X�B��C�C�C��X�C��D�D�D��X�D��A�A�A��X�A��A�A�A��X�A��J�J�J��X�J��(�(�(��X�(��%�%�%��X�%�%�%rr
�
csidl_namerrc���t|��}|�|Sdddd��|��}|�d|��}t|���tj�|��}|�d|��}t|���|S)z&Get folder from environment variables.N�APPDATA�ALLUSERSPROFILE�LOCALAPPDATA)rr)r�Unknown CSIDL name: zUnset environment variable: )�(get_win_folder_if_csidl_name_not_env_var�get�
ValueErrorr�environ)r]�result�env_var_name�msgs    r�get_win_folder_from_env_varsrj�s���
5�j�
A�
A�F�
���
�#� 1�-���
�c�*�o�o�	�
��1�Z�1�1����o�o��
�Z�^�^�L�
)�
)�F�
��;�\�;�;����o�o���Mrrc�D�|dkrMtj�tj�tjd��d��S|dkrMtj�tj�tjd��d��S|dkrMtj�tj�tjd��d��S|dkrMtj�tj�tjd��d	��S|d
krMtj�tj�tjd��d��SdS)
zMGet a folder for a CSIDL name that does not exist as an environment variable.r?�USERPROFILE�	DocumentsrC�	DownloadsrF�PicturesrI�VideosrM�MusicN)rrr$rrf)r]s rrcrc�s1���%�%�V��w�|�|�B�G�,�,�R�Z�
�-F�G�G��U�U�U��&�&�V��w�|�|�B�G�,�,�R�Z�
�-F�G�G��U�U�U��'�'�U��w�|�|�B�G�,�,�R�Z�
�-F�G�G��T�T�T��_�$�S��w�|�|�B�G�,�,�R�Z�
�-F�G�G��R�R�R��_�$�R��w�|�|�B�G�,�,�R�Z�
�-F�G�G��Q�Q�Q��4rc	�&�ddddddddd	��|��}|�d|��}t|���tjdkrt�d
d
l}|�|jd��}|�||��\}}t|��S)z�
    Get folder from the registry.

    This is a fallback technique at best. I'm not sure if using the registry for these guarantees us the correct answer
    for all CSIDL_* names.

    �AppDatazCommon AppDataz
Local AppData�Personalz&{374DE290-123F-4565-9164-39C4925E467B}zMy PictureszMy VideozMy Music)rr)rr?rCrFrIrMNrb�win32rz@Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders)
rdre�sys�platform�NotImplementedError�winreg�OpenKey�HKEY_CURRENT_USER�QueryValueExr)r]�shell_folder_nameriry�key�	directory�_s       r�get_win_folder_from_registryr��s���#� 0�.�$�C�)�#�#�	�	�
�c�*�o�o����1�Z�1�1����o�o��
�|�w��"�!�!��M�M�M�
�.�.��1�3v�
w�
w�C��&�&�s�,=�>�>�L�I�q��y�>�>�rc
��ddl}ddddddd	d
dd�	�|��}|�d
|��}t|���|�d��}t	|d��}|j�d|dd|��td�|D����r8|�d��}|j�	|j
|d��r|}|dkr%tj�
|j
d��S|j
S)zGet folder with ctypes.rN��#���'��
�(�)	rr)rr?rFrIrMrCrPrbi�windllc3�<K�|]}t|��dkV��dS)�N)�ord)�.0�cs  r�	<genexpr>z,get_win_folder_via_ctypes.<locals>.<genexpr>�s,����
%�
%�A�3�q�6�6�C�<�
%�
%�
%�
%�
%�
%rrCrn)�ctypesrdre�create_unicode_buffer�getattr�shell32�SHGetFolderPathW�any�kernel32�GetShortPathNameW�valuerrr$)r]r��csidl_constri�bufr��buf2s       r�get_win_folder_via_ctypesr��s.���M�M�M�� "�!������"$�
�
�
�c�*�o�o����1�Z�1�1����o�o��
�
&�
&�t�
,�
,�C�
�V�X�
&�
&�F�
�N�#�#�D�+�t�Q��D�D�D��
%�
%��
%�
%�
%�%�%���+�+�D�1�1���?�,�,�S�Y��d�C�C�	��C��&�&�4��w�|�|�C�I�{�3�3�3��9�r�Callable[[str], str]c��	ddl}t|d��rtSn#t$rYnwxYw	ddl}t
S#t$r
tcYSwxYw)Nrr�)r��hasattrr��ImportErrorryr�rj)r�rys  r�_pick_get_win_folderr��s���-��
�
�
��6�8�$�$�	-�,�,�	-���
�
�
���
����
,��
�
�
�,�+���,�,�,�+�+�+�+�,���s��
+�+�:�A�
A)�maxsize)r]rrr)r]rrr)rr�)rZ�
__future__rrrv�	functoolsr�typingr�apir�collections.abcrr
rjrcr�r�r�r�__all__r\rr�<module>r�sN����"�"�"�"�"�"�	�	�	�	�
�
�
�
������� � � � � � � � � � � � ��)�(�(�(�(�(�(�|%�|%�|%�|%�|%�o�|%�|%�|%�~����*����&����<$�$�$�$�N
,�
,�
,�
,� )���4�(�(�(�)=�)=�)?�)?�@�@������r