Current File : //usr/lib/python3/dist-packages/pip/_vendor/platformdirs/__pycache__/android.cpython-312.pyc
�

/�g+��,�dZddlmZddlZddlZddlZddlmZddlm	Z	ddl
mZGd�d	e�Zed�
�dd��Z
ed�
�dd��Zed�
�dd
��Zed�
�dd��Zed�
�dd��Zed�
�dd��Zd	gZy)zAndroid.�)�annotationsN)�	lru_cache)�cast�)�PlatformDirsABCc��eZdZdZedd��Zedd��Zedd��Zedd��Zedd��Z	edd��Z
edd��Zedd	��Zedd
��Z
edd��Zedd��Zedd
��Zedd��Zedd��Zy)�Androida$
    Follows the guidance `from here <https://android.stackexchange.com/a/216132>`_. Makes use of the
    `appname <platformdirs.api.PlatformDirsABC.appname>`,
    `version <platformdirs.api.PlatformDirsABC.version>`,
    `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`.
    c�R�|jttt��d�S)zd:return: data directory tied to the user, e.g. ``/data/user/<userid>/<packagename>/files/<AppName>``�files��_append_app_name_and_versionr�str�_android_folder��selfs �B/usr/lib/python3/dist-packages/pip/_vendor/platformdirs/android.py�
user_data_dirzAndroid.user_data_dir�!���0�0��c�?�;L�1M�w�W�W�c��|jS)z@:return: data directory shared by users, same as `user_data_dir`�rrs r�
site_data_dirzAndroid.site_data_dir����!�!�!rc�R�|jttt��d�S)z�
        :return: config directory tied to the user, e.g.         ``/data/user/<userid>/<packagename>/shared_prefs/<AppName>``
        �shared_prefsrrs r�user_config_dirzAndroid.user_config_dirs!���0�0��c�?�;L�1M�~�^�^rc��|jS)zH:return: config directory shared by the users, same as `user_config_dir`)rrs r�site_config_dirzAndroid.site_config_dir's���#�#�#rc�R�|jttt��d�S)zj:return: cache directory tied to the user, e.g. e.g. ``/data/user/<userid>/<packagename>/cache/<AppName>``�cacherrs r�user_cache_dirzAndroid.user_cache_dir,rrc��|jS)zB:return: cache directory shared by users, same as `user_cache_dir`)r!rs r�site_cache_dirzAndroid.site_cache_dir1s���"�"�"rc��|jS)zB:return: state directory tied to the user, same as `user_data_dir`rrs r�user_state_dirzAndroid.user_state_dir6rrc�v�|j}|jr tjj	|d�}|S)z�
        :return: log directory tied to the user, same as `user_cache_dir` if not opinionated else ``log`` in it,
          e.g. ``/data/user/<userid>/<packagename>/cache/<AppName>/log``
        �log�r!�opinion�os�path�join�rr+s  r�user_log_dirzAndroid.user_log_dir;�/���"�"���<�<��7�7�<�<��e�,�D��rc��t�S)zT:return: documents directory tied to the user e.g. ``/storage/emulated/0/Documents``)�_android_documents_folderrs r�user_documents_dirzAndroid.user_documents_dirF�
��)�*�*rc��t�S)zT:return: downloads directory tied to the user e.g. ``/storage/emulated/0/Downloads``)�_android_downloads_folderrs r�user_downloads_dirzAndroid.user_downloads_dirKr3rc��t�S)zR:return: pictures directory tied to the user e.g. ``/storage/emulated/0/Pictures``)�_android_pictures_folderrs r�user_pictures_dirzAndroid.user_pictures_dirPs
��(�)�)rc��t�S)zS:return: videos directory tied to the user e.g. ``/storage/emulated/0/DCIM/Camera``)�_android_videos_folderrs r�user_videos_dirzAndroid.user_videos_dirUs
��&�'�'rc��t�S)zL:return: music directory tied to the user e.g. ``/storage/emulated/0/Music``)�_android_music_folderrs r�user_music_dirzAndroid.user_music_dirZs
��%�&�&rc�v�|j}|jr tjj	|d�}|S)z�
        :return: runtime directory tied to the user, same as `user_cache_dir` if not opinionated else ``tmp`` in it,
          e.g. ``/data/user/<userid>/<packagename>/cache/<AppName>/tmp``
        �tmpr(r-s  r�user_runtime_dirzAndroid.user_runtime_dir_r/rN��returnr)�__name__�
__module__�__qualname__�__doc__�propertyrrrrr!r#r%r.r2r6r9r<r?rB�rrr	r	
s%����X��X��"��"��_��_��$��$��X��X��#��#��"��"������+��+��+��+��*��*��(��(��'��'����rr	)�maxsizec�F�	ddlm}|d�}|j�j�j	�}|S#t
$rYt
jd�}tjD]+}|j|�s�|jd�d}Y|Sd}Y|SwxYw)zE:return: base folder for the Android OS or None if it cannot be foundr��	autoclass�android.content.Contextz /data/(data|user/\d+)/(.+)/filesz/filesN)�jniusrN�getFilesDir�
getParentFile�getAbsolutePath�	Exception�re�compile�sysr+�match�split)rN�context�result�patternr+s     rrrks����#��5�6��$�0�0�2�@�@�B�R�R�T���M�����*�*�@�A���H�H�	�D��}�}�T�"����H�-�a�0����M�
	�
�F��M��s�:>�AB �B �B �B c��	ddlm}|d�}|d�}|j|j�j	�}|S#t
$rd}Y|SwxYw)z,:return: documents folder for the Android OSrrMrO�android.os.Environmentz/storage/emulated/0/Documents)rPrN�getExternalFilesDir�DIRECTORY_DOCUMENTSrSrT)rNrZ�environment�
documents_dirs    rr1r1��c��8�#��5�6��� 8�9��$�8�8��9X�9X�Y�i�i�k�
�����8�7�
���8���?A�A�Ac��	ddlm}|d�}|d�}|j|j�j	�}|S#t
$rd}Y|SwxYw)z,:return: downloads folder for the Android OSrrMrOr^z/storage/emulated/0/Downloads)rPrNr_�DIRECTORY_DOWNLOADSrSrT)rNrZra�
downloads_dirs    rr5r5�rcrdc��	ddlm}|d�}|d�}|j|j�j	�}|S#t
$rd}Y|SwxYw)z+:return: pictures folder for the Android OSrrMrOr^z/storage/emulated/0/Pictures)rPrNr_�DIRECTORY_PICTURESrSrT)rNrZra�pictures_dirs    rr8r8�sc��6�#��5�6��� 8�9��#�7�7��8V�8V�W�g�g�i������6�5����6�rdc��	ddlm}|d�}|d�}|j|j�j	�}|S#t
$rd}Y|SwxYw)z):return: videos folder for the Android OSrrMrOr^z/storage/emulated/0/DCIM/Camera)rPrNr_�DIRECTORY_DCIMrSrT)rNrZra�
videos_dirs    rr;r;�sc��7�#��5�6��� 8�9��!�5�5�k�6P�6P�Q�a�a�c�
�����7�6�
���7�rdc��	ddlm}|d�}|d�}|j|j�j	�}|S#t
$rd}Y|SwxYw)z(:return: music folder for the Android OSrrMrOr^z/storage/emulated/0/Music)rPrNr_�DIRECTORY_MUSICrSrT)rNrZra�	music_dirs    rr>r>�sc��0�#��5�6��� 8�9�� �4�4�[�5P�5P�Q�a�a�c�	�����0�/�	���0�rd)rDz
str | NonerC)rH�
__future__rr*rUrW�	functoolsr�typingr�apirr	rr1r5r8r;r>�__all__rJrr�<module>rvs����"�	�	�
��� �[�o�[�|�1�����(�1������1������1������1������1����� ��r