Edit File: windows.cpython-311.pyc
� ����o�d�����������������������������d�dl�mZ�d�dlZd�dlZd�dlZd�dlmZ�d�dlmZ�ddl m Z ��G�d��de ������������Zdd�Zdd �Z dd�Zdd�Z��ed��������������e��������������������������ZdgZdS�)�����)�annotationsN)� lru_cache)�Callable����)�PlatformDirsABCc������������������������e�Zd�ZdZedd���������������Zdd�dd �Zedd���������������Zedd���������������Zedd ���������������Z edd���������������Z edd���������������Zedd���������������Zedd���������������Z edd���������������ZdS�)�Windowsa���`MSDN on where to store app data files <http://support.microsoft.com/default.aspx?scid=kb;en-us;310294#XSLTH3194121123120121120120>`_. 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>`.�return�strc����������������������|�j���������rdnd}t����������j�����������������������������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�constr���s��� �e/builddir/build/BUILD/cloudlinux-venv-1.0.2/venv/lib/python3.11/site-packages/platformdirs/windows.py� user_data_dirzWindows.user_data_dir���sF�������$(�<�J���5J���w����u� 5� 5�6�6���!�!�$�'�'�'�����N�� opinion_valuer���r���� str | Nonec����������������L����g�}|�j���������r�|�j��������dur#|�j��������p|�j���������}|���������������������|�������������|���������������������|�j����������������������|�|�j��������r|���������������������|�������������|�j��������r|���������������������|�j���������������������t����������j��������j��������|g|�R���S�)NF)�appname� appauthor�append�opinion�versionr���r����join)r���r���r����params�authors��� r���r���zWindows._append_parts!���s����������<�� ,��~�U�*�*���7�4�<��� � �f�%�%�%��M�M�$�,�'�'�'��(�T�\�(�� � �m�,�,�,��|�� ,�� � �d�l�+�+�+��w�|�D�*�6�*�*�*�*r���c����������������������t�����������j�����������������������������t����������d������������������������}|����������������������|������������S�)zT:return: data directory shared by users, e.g. ``C:\ProgramData\$appauthor\$appname``�CSIDL_COMMON_APPDATA�r���r���r���r���r����r���r���s��� r���� site_data_dirzWindows.site_data_dir.���s6��������w����/E� F� F�G�G���!�!�$�'�'�'r���c����������������������|�j���������S�)zC:return: config directory tied to the user, same as `user_data_dir`�r����r���s��� r����user_config_dirzWindows.user_config_dir4���� ��������!�!r���c����������������������|�j���������S�)zF:return: config directory shared by the users, same as `site_data_dir`)r*���r-���s��� r����site_config_dirzWindows.site_config_dir9���r/���r���c����������������������t�����������j�����������������������������t����������d������������������������}|����������������������|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����Cacher���r(���r)���s��� r����user_cache_dirzWindows.user_cache_dir>���s;��������w����/D� E� E�F�F���!�!�$�g�!�>�>�>r���c����������������������|�j���������S�)zB:return: state directory tied to the user, same as `user_data_dir`r,���r-���s��� r����user_state_dirzWindows.user_state_dirG���r/���r���c�����������������b�����|�j���������}|�j��������r t����������j�����������������������������|d������������}|S�)zy :return: log directory tied to the user, same as `user_data_dir` if not opinionated else ``Logs`` in it �Logs)r���r!���r���r���r#���r)���s��� r����user_log_dirzWindows.user_log_dirL���s0������ ��!���<�� .��7�<�<��f�-�-�D��r���c�����������������Z�����t�����������j�����������������������������t����������d������������������������S�)z` :return: documents directory tied to the user e.g. ``%USERPROFILE%\Documents`` �CSIDL_PERSONAL)r���r���r���r���r-���s��� r����user_documents_dirzWindows.user_documents_dirV���s#������ ��w����/?� @� @�A�A�Ar���c����������������������t�����������j�����������������������������t�����������j�����������������������������t ����������d������������d������������������������}|����������������������|������������S�)z� :return: runtime directory tied to the user, e.g. ``%USERPROFILE%\AppData\Local\Temp\$appauthor\$appname`` r����Temp)r���r���r���r#���r���r���r)���s��� r����user_runtime_dirzWindows.user_runtime_dir]���sG��������w�������^�<Q�-R�-R�TZ� [� [�\�\���!�!�$�'�'�'r���)r ���r���)r���r���r���r���r ���r���)�__name__� __module__�__qualname__�__doc__�propertyr���r���r*���r.���r1���r4���r6���r9���r<���r?�����r���r���r ���r ������sg�������������=��=���(��(��(���X�(��GK��+��+��+��+��+��+���(��(��(���X�(� ��"��"��"���X�"���"��"��"���X�"���?��?��?���X�?���"��"��"���X�"����������X����B��B��B���X�B���(��(��(���X�(��(��(r���r ���� csidl_namer���r ���c�����������������l����|�dk����rMt�����������j�����������������������������t�����������j�����������������������������t�����������j��������d���������������������d������������S�dddd����������������������|�������������}|�t ����������d |�����������������t�����������j�����������������������������|������������}|�t ����������d |����������������|S�)z&Get folder from environment variables.r;����USERPROFILE� Documents�APPDATA�ALLUSERSPROFILE�LOCALAPPDATA)r ���r'���r���N�Unknown CSIDL name: zUnset environment variable: )r���r���r#���r����environ�get� ValueError)rF����env_var_name�results��� r����get_win_folder_from_env_varsrS���g���s��������%�%�%��w�|�|�B�G�,�,�R�Z� �-F�G�G��U�U�U��#� 1�-����� �c�*�o�o� �� ����<� �<�<�=�=�=� �Z�^�^�L� )� )�F� �~��F��F�F�G�G�G��Mr���c���������������������ddddd�����������������������|�������������}|�t����������d|�����������������t����������j��������dk����rt�����������d dl}|���������������������|j��������d ������������}|���������������������||������������\��}}t����������|������������S�)z�Get folder from the registry. This is a fallback technique at best. I'm not sure if using the registry for this guarantees us the correct answer for all CSIDL_* names. �AppDatazCommon AppDataz Local AppData�Personal�r ���r'���r���r;���NrM����win32r���z@Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders) rO���rP����sys�platform�NotImplementedError�winreg�OpenKey�HKEY_CURRENT_USER�QueryValueExr���)rF����shell_folder_namer\����key� directory�_s��� r����get_win_folder_from_registryrd���y���s��������#� 0�.�$� ��� � �c�*�o�o����� ��<� �<�<�=�=�=� �|�w���!�!��M�M�M� �.�.��1�3v� w� w�C��&�&�s�,=�>�>�L�I�q��y�>�>�r���c���������������������ddddd�����������������������|�������������}|�t����������d|�����������������t����������j��������d������������}t ����������t����������d ������������}|j�����������������������������d|dd |�������������t����������d��|D���������������������������r7t����������j��������d������������}|j��������� ��������������������|j ��������|d������������r|}|j ��������S�)zGet folder with ctypes.�����#�����������rW���NrM���i����windllr���c��������������3���<���K����|�]}t����������|������������d�k����V����dS�)����N)�ord)�.0�cs��� r���� <genexpr>z,get_win_folder_via_ctypes.<locals>.<genexpr>����s,���������� %� %�A�3�q�6�6�C�<� %� %� %� %� %� %r���)rO���rP����ctypes�create_unicode_buffer�getattr�shell32�SHGetFolderPathW�any�kernel32�GetShortPathNameW�value)rF����csidl_const�bufrj����buf2s��� r����get_win_folder_via_ctypesr}�������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�r����Callable[[str], str]c�����������������������t����������t����������d������������rt����������S� �dd�l}�t����������S�#�t ����������$�r �t����������cY�S�w�xY�w)Nrj���r���)�hasattrrq���r}���r\���rd����ImportErrorrS���)r\���s��� r����_pick_get_win_folderr��������sY�������v�x� � ��)�(�(�,�� � � ��,�+�����,��,��,�+�+�+�+�,���s����)��=�=)�maxsize)rF���r���r ���r���)r ���r~���)� __future__r���rq���r���rY���� functoolsr����typingr����apir���r ���rS���rd���r}���r����r����__all__rE���r���r����<module>r�������s#�����"��"��"��"��"��"�� � � � �� � � � �� � � � �������������������������� �� �� �� �� �� �X(��X(��X(��X(��X(�o��X(��X(��X(�v�������$�������0�������0,��,��,��,��)���4�(�(�(�)=�)=�)?�)?�@�@�������r���