Edit File: unix.cpython-311.pyc
� ����o�d����������������������������d�dl�mZ�d�dlZd�dlZd�dlmZ�d�dlmZ�ddlm Z �ej �����������������������������d������������rd�dlmZ�ndd�Z�G�d��d e ������������Z dd�Zd gZdS�)�����)�annotationsN)�ConfigParser)�Path����)�PlatformDirsABC�linux)�getuid�return�intc������������������ �����t����������d�������������)Nzshould only be used on Linux)�RuntimeError��������b/builddir/build/BUILD/cloudlinux-venv-1.0.2/venv/lib/python3.11/site-packages/platformdirs/unix.pyr ���r ������s�������9�:�:�:r���c�������������������*����e�Zd�ZdZedd���������������Zedd���������������Zdd�Zedd���������������Zedd ���������������Z edd ���������������Z edd���������������Zedd���������������Zedd ���������������Z edd���������������Zedd���������������Zedd���������������Zdd�ZdS�)�UnixaD�� On Unix/Linux, we follow the `XDG Basedir Spec <https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html>`_. The spec allows overriding directories with environment variables. The examples show are the default values, alongside the name of the environment variable that overrides them. Makes use of the `appname <platformdirs.api.PlatformDirsABC.appname>`, `version <platformdirs.api.PlatformDirsABC.version>`, `multipath <platformdirs.api.PlatformDirsABC.multipath>`, `opinion <platformdirs.api.PlatformDirsABC.opinion>`. r ����strc�����������������������t�����������j�����������������������������dd������������}|�����������������������������������st�����������j�����������������������������d������������}|����������������������|������������S�)z� :return: data directory tied to the user, e.g. ``~/.local/share/$appname/$version`` or ``$XDG_DATA_HOME/$appname/$version`` � XDG_DATA_HOME��z~/.local/share��os�environ�get�strip�path� expanduser�_append_app_name_and_version��selfr���s��� r���� user_data_dirzUnix.user_data_dir���sS��������z�~�~�o�r�2�2���z�z�|�|�� 8��7�%�%�&6�7�7�D��0�0��6�6�6r���c����������������������t�����������j�����������������������������dd������������}|�����������������������������������sdt�����������j����������d�}|����������������������|������������S�)aY�� :return: data directories shared by users (if `multipath <platformdirs.api.PlatformDirsABC.multipath>` is enabled and ``XDG_DATA_DIR`` is set and a multi path the response is also a multi path separated by the OS path separator), e.g. ``/usr/local/share/$appname/$version`` or ``/usr/share/$appname/$version`` � XDG_DATA_DIRSr���z/usr/local/sharez /usr/share)r���r���r���r����pathsep�_with_multi_pathr���s��� r���� site_data_dirzUnix.site_data_dir)���sO��������z�~�~�o�r�2�2���z�z�|�|�� =�<�b�j�<�<�<�D��$�$�T�*�*�*r���r���c������������������������|����������������������t����������j��������������������}��j��������s |dd����������}��fd�|D���������������}t����������j�����������������������������|������������S�)Nr���r���c�����������������t������g�|�]4}�����������������������t����������j�����������������������������|��������������������������5S�r���)r���r���r���r���)�.0�pr ���s��� �r���� <listcomp>z)Unix._with_multi_path.<locals>.<listcomp>:���s8�������a�a�a�RS�T�6�6�r�w�7I�7I�!�7L�7L�M�M�a�a�ar���)�splitr���r$���� multipath�join)r ���r���� path_lists���` r���r%���zUnix._with_multi_path6���s[��������J�J�r�z�*�*� ��~�� '�!�!�A�#��I�a�a�a�a�W`�a�a�a� ��z���y�)�)�)r���c�����������������������t�����������j�����������������������������dd������������}|�����������������������������������st�����������j�����������������������������d������������}|����������������������|������������S�)z� :return: config directory tied to the user, e.g. ``~/.config/$appname/$version`` or ``$XDG_CONFIG_HOME/$appname/$version`` �XDG_CONFIG_HOMEr���z ~/.configr���r���s��� r����user_config_dirzUnix.user_config_dir=���sS��������z�~�~�/��4�4���z�z�|�|�� 3��7�%�%�k�2�2�D��0�0��6�6�6r���c����������������������t�����������j�����������������������������dd������������}|�����������������������������������sd}|����������������������|������������S�)a/�� :return: config directories shared by users (if `multipath <platformdirs.api.PlatformDirsABC.multipath>` is enabled and ``XDG_DATA_DIR`` is set and a multi path the response is also a multi path separated by the OS path separator), e.g. ``/etc/xdg/$appname/$version`` �XDG_CONFIG_DIRSr���z/etc/xdg)r���r���r���r���r%���r���s��� r����site_config_dirzUnix.site_config_dirH���sC��������z�~�~�/��4�4���z�z�|�|�� ��D��$�$�T�*�*�*r���c�����������������������t�����������j�����������������������������dd������������}|�����������������������������������st�����������j�����������������������������d������������}|����������������������|������������S�)z� :return: cache directory tied to the user, e.g. ``~/.cache/$appname/$version`` or ``~/$XDG_CACHE_HOME/$appname/$version`` �XDG_CACHE_HOMEr���z~/.cacher���r���s��� r����user_cache_dirzUnix.user_cache_dirU���sS��������z�~�~�.��3�3���z�z�|�|�� 2��7�%�%�j�1�1�D��0�0��6�6�6r���c�����������������������t�����������j�����������������������������dd������������}|�����������������������������������st�����������j�����������������������������d������������}|����������������������|������������S�)z� :return: state directory tied to the user, e.g. ``~/.local/state/$appname/$version`` or ``$XDG_STATE_HOME/$appname/$version`` �XDG_STATE_HOMEr���z~/.local/stater���r���s��� r����user_state_dirzUnix.user_state_dir`���sT��������z�~�~�.��3�3���z�z�|�|�� 8��7�%�%�&6�7�7�D��0�0��6�6�6r���c�����������������b�����|�j���������}|�j��������r t����������j�����������������������������|d������������}|S�)zy :return: log directory tied to the user, same as `user_state_dir` if not opinionated else ``log`` in it �log)r;����opinionr���r���r.���r���s��� r����user_log_dirzUnix.user_log_dirk���s0������ ��"���<�� -��7�<�<��e�,�,�D��r���c�����������������������t����������d������������}|�St����������j�����������������������������dd�����������������������������������������������}|st����������j�����������������������������d������������}|S�)zU :return: documents directory tied to the user, e.g. ``~/Documents`` �XDG_DOCUMENTS_DIRNr���z~/Documents)�_get_user_dirs_folderr���r���r���r���r���r���)r ���� documents_dirs��� r����user_documents_dirzUnix.user_documents_diru���s^������ �.�.A�B�B� �� ��J�N�N�+>��C�C�I�I�K�K�M� �� B� "�� 2� 2�=� A� A� ��r���c����������������������t�����������j�����������������������������dd������������}|�����������������������������������sdt ���������������������������}|����������������������|������������S�)z� :return: runtime directory tied to the user, e.g. ``/run/user/$(id -u)/$appname/$version`` or ``$XDG_RUNTIME_DIR/$appname/$version`` �XDG_RUNTIME_DIRr���z /run/user/)r���r���r���r���r ���r���r���s��� r����user_runtime_dirzUnix.user_runtime_dir����sO��������z�~�~�/��4�4���z�z�|�|�� +�*����*�*�D��0�0��6�6�6r���r���c�����������������6�����|�����������������������|�j��������������������S�)zd:return: data path shared by users. Only return first item, even if ``multipath`` is set to ``True``)� _first_item_as_path_if_multipathr&����r ���s��� r����site_data_pathzUnix.site_data_path����s��������4�4�T�5G�H�H�Hr���c�����������������6�����|�����������������������|�j��������������������S�)zj:return: config path shared by the users. Only return first item, even if ``multipath`` is set to ``True``)rI���r5���rJ���s��� r����site_config_pathzUnix.site_config_path����s��������4�4�T�5I�J�J�Jr���� directoryc�����������������x�����|�j���������r%|���������������������t����������j��������������������d���������}t ����������|������������S�)Nr���)r-���r,���r���r$���r���)r ���rN���s��� r���rI���z%Unix._first_item_as_path_if_multipath����s0�������>�� 7�!���� �3�3�A�6�I��I���r���N)r ���r���)r���r���r ���r���)r ���r���)rN���r���r ���r���)�__name__� __module__�__qualname__�__doc__�propertyr!���r&���r%���r2���r5���r8���r;���r?���rD���rG���rK���rM���rI���r���r���r���r���r������s�������������� �� ���7��7��7���X�7��� +�� +�� +���X� +�*��*��*��*���7��7��7���X�7��� +�� +�� +���X� +���7��7��7���X�7���7��7��7���X�7����������X���� �� �� ���X� ���7��7��7���X�7���I��I��I���X�I���K��K��K���X�K�����������r���r����keyr���� str | Nonec�����������������(����t�����������j�����������������������������t������������������������j��������d������������}t�����������j�����������������������������|������������r�t ������������������������}t����������|������������5�}|���������������������d|� ��������������������������������������������������ddd�������������n#�1�swxY�w�Y���|�|d���������vrdS�|d���������|����������� ��������������������d������������}|���������������������dt�����������j�����������������������������d������������������������}|S�dS�)zjReturn directory from user-dirs.dirs config file. See https://freedesktop.org/wiki/Software/xdg-user-dirs/zuser-dirs.dirsz[top] N�top�"z$HOME�~) r���r���r.���r���r2����existsr����open�read_string�readr����replacer���)rU����user_dirs_config_path�parser�streamr���s��� r���rB���rB�������s%������G�L�L����)?�AQ�R�R�� �w�~�~�+�,�,�� ����� �'� (� (�� :�F����8������8�8�9�9�9� :�� :�� :�� :�� :�� :�� :�� :�� :�� :�� :����� :�� :�� :�� :���f�U�m�#�#��4��e�}�S�!�'�'��,�,���|�|�G�R�W�%7�%7��%<�%<�=�=�����4s����.+B%�%B)�,B))r ���r���)rU���r���r ���rV���)� __future__r���r����sys�configparserr����pathlibr����apir����platform� startswithr ���r���rB����__all__r���r���r����<module>rk������s�������"��"��"��"��"��"�� � � � �� � � � ��%��%��%��%��%��%�������������� �� �� �� �� �� ��<���7�#�#��;��������;��;��;��;�I��I��I��I��I�?��I��I��I�X�������,�����r���