관리-도구
편집 파일: android.cpython-37.pyc
B Ĥ�a� � @ s� d dl mZ d dlZd dlZd dlZd dlmZ ddlmZ G dd� de�Z edd�d d �dd��Z edd�d d �d d��ZdgZdS )� )�annotationsN)� lru_cache� )�PlatformDirsABCc @ s� e Zd ZdZedd�dd��Zedd�dd��Zedd�dd ��Zedd�d d��Zedd�dd ��Z edd�dd��Z edd�dd��Zedd�dd��Zedd�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)�returnc C s | � 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_dir s zAndroid.user_data_dirc C s | j S )z@:return: data directory shared by users, same as `user_data_dir`)r )r r r r � site_data_dir s zAndroid.site_data_dirc C s | � t� d�S )z :return: config directory tied to the user, e.g. ``/data/user/<userid>/<packagename>/shared_prefs/<AppName>`` Zshared_prefs)r r )r r r r �user_config_dir s zAndroid.user_config_dirc C s | j S )zH:return: config directory shared by the users, same as `user_config_dir`)r )r r r r �site_config_dir# s zAndroid.site_config_dirc C s | � 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( s zAndroid.user_cache_dirc C s | j S )zB:return: state directory tied to the user, same as `user_data_dir`)r )r r r r �user_state_dir- s zAndroid.user_state_dirc C s | 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 r r r r �user_log_dir2 s zAndroid.user_log_dirc C s t � 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= s zAndroid.user_documents_dirc C s | 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)r r r r r )r r r r r �user_runtime_dirD s zAndroid.user_runtime_dirN)�__name__� __module__�__qualname__�__doc__�propertyr r r r r r r r r r r r r r s r )�maxsizer )r c C s~ y(ddl m} | d�}|�� �� �� }W nP tk rx t�d�}x0tj D ]}|� |�rJ|�d�d }P qJW td��Y nX |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&