AlkantarClanX12

Your IP : 18.188.107.57


Current Path : /opt/alt/python37/lib/python3.7/site-packages/platformdirs/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/platformdirs/__pycache__/android.cpython-37.pyc

B

Ĥ�a��@s�ddlmZddlZddlZddlZddlmZddlmZGdd�de�Z	edd�d	d
�dd��Z
edd�d	d
�d
d��ZdgZdS)�)�annotationsN)�	lru_cache�)�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
dS)�Androidz�
    Follows the guidance `from here <https://android.stackexchange.com/a/216132>`_. Makes use of the
    `appname <platformdirs.api.PlatformDirsABC.appname>` and
    `version <platformdirs.api.PlatformDirsABC.version>`.
    �str)�returncCs|�t�d�S)zd:return: data directory tied to the user, e.g. ``/data/user/<userid>/<packagename>/files/<AppName>``�files)�_append_app_name_and_version�_android_folder)�self�r
�E/opt/alt/python37/lib/python3.7/site-packages/platformdirs/android.py�
user_data_dirszAndroid.user_data_dircCs|jS)z@:return: data directory shared by users, same as `user_data_dir`)r)rr
r
r�
site_data_dirszAndroid.site_data_dircCs|�t�d�S)z
        :return: config directory tied to the user, e.g. ``/data/user/<userid>/<packagename>/shared_prefs/<AppName>``
        Zshared_prefs)r
r)rr
r
r�user_config_dirszAndroid.user_config_dircCs|jS)zH:return: config directory shared by the users, same as `user_config_dir`)r)rr
r
r�site_config_dir#szAndroid.site_config_dircCs|�t�d�S)zj:return: cache directory tied to the user, e.g. e.g. ``/data/user/<userid>/<packagename>/cache/<AppName>``�cache)r
r)rr
r
r�user_cache_dir(szAndroid.user_cache_dircCs|jS)zB:return: state directory tied to the user, same as `user_data_dir`)r)rr
r
r�user_state_dir-szAndroid.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rr
r
r�user_log_dir2szAndroid.user_log_dircCst�S)zf
        :return: documents directory tied to the user e.g. ``/storage/emulated/0/Documents``
        )�_android_documents_folder)rr
r
r�user_documents_dir=szAndroid.user_documents_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rr
r
r�user_runtime_dirDszAndroid.user_runtime_dirN)�__name__�
__module__�__qualname__�__doc__�propertyrrrrrrrrrr
r
r
rrsr)�maxsizer)rcCs~y(ddlm}|d�}|������}WnPtk
rxt�d�}x0tj	D]}|�
|�rJ|�d�d}PqJWtd��YnX|S)z':return: base folder for the Android OSr)�	autoclasszandroid.content.Contextz /data/(data|user/\d+)/(.+)/filesz/filesz&Cannot find path to android app folder)
�jniusr&ZgetFilesDirZ
getParentFile�getAbsolutePath�	Exception�re�compile�sysr�match�split�OSError)r&�Context�result�patternrr
r
rrPs

rcCsNy0ddlm}|d�}|d�}|�|j���}Wntk
rHd}YnX|S)z,:return: documents folder for the Android OSr)r&zandroid.content.Contextzandroid.os.Environmentz/storage/emulated/0/Documents)r'r&ZgetExternalFilesDirZDIRECTORY_DOCUMENTSr(r))r&r0�EnvironmentZ
documents_dirr
r
rres
r)
�
__future__rrr*r,�	functoolsrZapirrrr�__all__r
r
r
r�<module>sE