� ��^i����ddlZddlZddlmZddlmZmZddlmZGd�de��Z de d e fd �Z de d e fd �Z de d e fd �Z d ee ge ffd �Zed���e����ZdgZdS)�N)� lru_cache)�Callable�Optional�)�PlatformDirsABCc�4�eZdZdZedefd���Zdd�dedeedefd�Zedefd ���Z edefd ���Z edefd ���Z edefd ���Z edefd ���Z edefd���Zedefd���Zedefd���ZdS)�Windowsa�`MSDN on where to store app data files `_. Makes use of the `appname `, `appauthor `, `version `, `roaming `, `opinion `.�returnc��|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 ��/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/platformdirs/windows.py� user_data_dirzWindows.user_data_dirsF��$(�<�J���5J���w����u� 5� 5�6�6���!�!�$�'�'�'�N�� opinion_valuerrc�L�g}|jr�|jdur#|jp|j}|�|��|�|j��|�|jr|�|��|jr|�|j��t jj|g|�R�S)NF)�appname� appauthor�append�opinion�versionrr�join)rrr�params�authors rrzWindows._append_partss����� �<� ,��~�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_dir+s6���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_dir1� ���!�!rc��|jS)zF:return: config directory shared by the users, same as `site_data_dir`)r(r+s r�site_config_dirzWindows.site_config_dir6r-rc��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_dir;s;�� �w����/D� E� E�F�F���!�!�$�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_dirDr-rc�b�|j}|jr tj�|d��}|S)zy :return: log directory tied to the user, same as `user_data_dir` if not opinionated else ``Logs`` in it �Logs)rrrrr!r's r� user_log_dirzWindows.user_log_dirIs0�� �!�� �<� .��7�<�<��f�-�-�D�� rc�Z�tj�td����S)z` :return: documents directory tied to the user e.g. ``%USERPROFILE%\Documents`` �CSIDL_PERSONAL)rrrrr+s r�user_documents_dirzWindows.user_documents_dirSs#�� �w����/?� @� @�A�A�Arc���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_dirZsG�� �w����� � �^��>�L�I�q� �y�>�>�rc��ddddd��|��}|�td|�����tjd��}t td ��}|j�d|dd |��td �|D����r7tjd��}|j� |j |d��r|}|j S) zGet folder with ctypes.��#��rVNrLi�windllrc3�<K�|]}t|��dkV��dS)��N)�ord)�.0�cs r� z,get_win_folder_via_ctypes..�s,���� %� %�A�3�q�6�6�C�<� %� %� %� %� %� %r) rNrO�ctypes�create_unicode_buffer�getattr�shell32�SHGetFolderPathW�any�kernel32�GetShortPathNameW�value)rE� csidl_const�bufre�buf2s r�get_win_folder_via_ctypesrx�s���� "�!�� ��  �c�*�o�o� � ���<� �<�<�=�=�=� � &�t� ,� ,�C� �V�X� &� &�F� �N�#�#�D�+�t�Q��D�D�D� � %� %�� %� %� %�%�%���+�D�1�1�� �?� ,� ,�S�Y��d� C� C� ��C� �9�rc��ttd��rtS ddl}tS#t $r t cYSwxYw)Nrer)�hasattrrlrxrWr_� ImportErrorrR)rWs r�_pick_get_win_folderr|�sY���v�x� � �)�(�(�,�� � � �,�+�� �,�,�,�+�+�+�+�,���s �)�=�=)�maxsize)rlr� functoolsr�typingrr�apirr rCrRr_rxr|r�__all__rDrr�r�sJ�� � � � � � � � �������%�%�%�%�%�%�%�%� � � � � � �X(�X(�X(�X(�X(�o�X(�X(�X(�v�S��S�����$�S��S�����.�#��#�����0,�h��u�c�z�2�,�,�,�,�)���4�(�(�(�)=�)=�)?�)?�@�@��� ���r