HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/site-packages/pip/_vendor/platformdirs/__pycache__/android.cpython-37.pyc
B

L��g+�@s�dZddlmZddlZddlZddlZddlmZddlm	Z	ddl
mZGdd	�d	e�Zedd
�dd�d
d��Z
edd
�dd�dd��Zedd
�dd�dd��Zedd
�dd�dd��Zedd
�dd�dd��Zedd
�dd�dd��Zd	gZdS)zAndroid.�)�annotationsN)�	lru_cache)�cast�)�PlatformDirsABCc@seZdZdZedd�dd��Zedd�dd��Zedd�dd	��Zedd�d
d��Zedd�dd
��Z	edd�dd��Z
edd�dd��Zedd�dd��Zedd�dd��Z
edd�dd��Zedd�dd��Zedd�dd��Zedd�dd��Zedd�dd��Zd S)!�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>`.
    �str)�returncCs|�ttt��d�S)zd:return: data directory tied to the user, e.g. ``/data/user/<userid>/<packagename>/files/<AppName>``�files)�_append_app_name_and_versionrr�_android_folder)�self�r�D/tmp/pip-unpacked-wheel-hv55ucu3/pip/_vendor/platformdirs/android.py�
user_data_dirszAndroid.user_data_dircCs|jS)z@:return: data directory shared by users, same as `user_data_dir`)r)r
rrr�
site_data_dirszAndroid.site_data_dircCs|�ttt��d�S)z�
        :return: config directory tied to the user, e.g.         ``/data/user/<userid>/<packagename>/shared_prefs/<AppName>``
        Zshared_prefs)rrrr)r
rrr�user_config_dirszAndroid.user_config_dircCs|jS)zH:return: config directory shared by the users, same as `user_config_dir`)r)r
rrr�site_config_dir'szAndroid.site_config_dircCs|�ttt��d�S)zj:return: cache directory tied to the user, e.g. e.g. ``/data/user/<userid>/<packagename>/cache/<AppName>``�cache)rrrr)r
rrr�user_cache_dir,szAndroid.user_cache_dircCs|jS)zB:return: cache directory shared by users, same as `user_cache_dir`)r)r
rrr�site_cache_dir1szAndroid.site_cache_dircCs|jS)zB:return: state directory tied to the user, same as `user_data_dir`)r)r
rrr�user_state_dir6szAndroid.user_state_dircCs|j}|jrtj�|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)r
rrrr�user_log_dir;szAndroid.user_log_dircCst�S)zT:return: documents directory tied to the user e.g. ``/storage/emulated/0/Documents``)�_android_documents_folder)r
rrr�user_documents_dirFszAndroid.user_documents_dircCst�S)zT:return: downloads directory tied to the user e.g. ``/storage/emulated/0/Downloads``)�_android_downloads_folder)r
rrr�user_downloads_dirKszAndroid.user_downloads_dircCst�S)zR:return: pictures directory tied to the user e.g. ``/storage/emulated/0/Pictures``)�_android_pictures_folder)r
rrr�user_pictures_dirPszAndroid.user_pictures_dircCst�S)zS:return: videos directory tied to the user e.g. ``/storage/emulated/0/DCIM/Camera``)�_android_videos_folder)r
rrr�user_videos_dirUszAndroid.user_videos_dircCst�S)zL:return: music directory tied to the user e.g. ``/storage/emulated/0/Music``)�_android_music_folder)r
rrr�user_music_dirZszAndroid.user_music_dircCs|j}|jrtj�|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``
        �tmp)rrrrr)r
rrrr�user_runtime_dir_szAndroid.user_runtime_dirN)�__name__�
__module__�__qualname__�__doc__�propertyrrrrrrrrrr!r#r%r'r)rrrrr
sr)�maxsizez
str | None)r	cCszy(ddlm}|d�}|������}WnLtk
rtt�d�}x,tj	D]}|�
|�rJ|�d�d}PqJWd}YnX|S)zE:return: base folder for the Android OS or None if it cannot be foundr)�	autoclasszandroid.content.Contextz /data/(data|user/\d+)/(.+)/filesz/filesN)�jniusr0ZgetFilesDirZ
getParentFile�getAbsolutePath�	Exception�re�compile�sysr�match�split)r0�context�result�patternrrrrrks


rrcCsNy0ddlm}|d�}|d�}|�|j���}Wntk
rHd}YnX|S)z,:return: documents folder for the Android OSr)r0zandroid.content.Contextzandroid.os.Environmentz/storage/emulated/0/Documents)r1r0�getExternalFilesDirZDIRECTORY_DOCUMENTSr2r3)r0r9�environmentZ
documents_dirrrrr�s
rcCsNy0ddlm}|d�}|d�}|�|j���}Wntk
rHd}YnX|S)z,:return: downloads folder for the Android OSr)r0zandroid.content.Contextzandroid.os.Environmentz/storage/emulated/0/Downloads)r1r0r<ZDIRECTORY_DOWNLOADSr2r3)r0r9r=Z
downloads_dirrrrr �s
r cCsNy0ddlm}|d�}|d�}|�|j���}Wntk
rHd}YnX|S)z+:return: pictures folder for the Android OSr)r0zandroid.content.Contextzandroid.os.Environmentz/storage/emulated/0/Pictures)r1r0r<ZDIRECTORY_PICTURESr2r3)r0r9r=Zpictures_dirrrrr"�s
r"cCsNy0ddlm}|d�}|d�}|�|j���}Wntk
rHd}YnX|S)z):return: videos folder for the Android OSr)r0zandroid.content.Contextzandroid.os.Environmentz/storage/emulated/0/DCIM/Camera)r1r0r<ZDIRECTORY_DCIMr2r3)r0r9r=Z
videos_dirrrrr$�s
r$cCsNy0ddlm}|d�}|d�}|�|j���}Wntk
rHd}YnX|S)z(:return: music folder for the Android OSr)r0zandroid.content.Contextzandroid.os.Environmentz/storage/emulated/0/Music)r1r0r<ZDIRECTORY_MUSICr2r3)r0r9r=Z	music_dirrrrr&�s
r&)r-�
__future__rrr4r6�	functoolsr�typingr�apirrrrr r"r$r&�__all__rrrr�<module>s^