HEX
Server: Apache
System: Linux br512.hostgator.com.br 5.14.0-162.23.1.9991722448259.nf.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 31 18:11:45 UTC 2024 x86_64
User: stiliz28 (2548)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: //lib/python3.9/site-packages/platformdirs/__pycache__/unix.cpython-39.opt-1.pyc
a

y��d��@s�ddlmZddlZddlZddlmZddlmZddlm	Z	ej
�d�rZddlmZnd	d
�dd�ZGd
d�de	�Z
ddd�dd�ZdgZdS)�)�annotationsN)�ConfigParser)�Path�)�PlatformDirsABCZlinux)�getuid�int��returncCstd��dS)Nzshould only be used on Linux)�RuntimeError�rr�5/usr/lib/python3.9/site-packages/platformdirs/unix.pyrsrc@s�eZdZdZedd�dd��Zedd�dd��Zddd�d	d
�Zedd�dd��Zedd�d
d��Z	edd�dd��Z
edd�dd��Zedd�dd��Zedd�dd��Z
edd�dd��Zedd�dd��Zedd�dd��Zddd�dd �Zd!S)"�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>`.
    �strr	cCs,tj�dd�}|��s"tj�d�}|�|�S)z�
        :return: data directory tied to the user, e.g. ``~/.local/share/$appname/$version`` or
         ``$XDG_DATA_HOME/$appname/$version``
        Z
XDG_DATA_HOME�z~/.local/share��os�environ�get�strip�path�
expanduser�_append_app_name_and_version��selfrrrr
�
user_data_dirszUnix.user_data_dircCs.tj�dd�}|��s$dtj�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``
        Z
XDG_DATA_DIRSrz/usr/local/sharez
/usr/share)rrrr�pathsep�_with_multi_pathrrrr
�
site_data_dir)szUnix.site_data_dir)rr
cs<|�tj�}�js|dd�}�fdd�|D�}tj�|�S)Nrrcsg|]}��tj�|���qSr)rrrr)�.0�p�rrr
�
<listcomp>:�z)Unix._with_multi_path.<locals>.<listcomp>)�splitrr�	multipath�join)rr�	path_listrr!r
r6s
zUnix._with_multi_pathcCs,tj�dd�}|��s"tj�d�}|�|�S)z�
        :return: config directory tied to the user, e.g. ``~/.config/$appname/$version`` or
         ``$XDG_CONFIG_HOME/$appname/$version``
        ZXDG_CONFIG_HOMErz	~/.configrrrrr
�user_config_dir=szUnix.user_config_dircCs$tj�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``
        ZXDG_CONFIG_DIRSrz/etc/xdg)rrrrrrrrr
�site_config_dirHszUnix.site_config_dircCs,tj�dd�}|��s"tj�d�}|�|�S)z�
        :return: cache directory tied to the user, e.g. ``~/.cache/$appname/$version`` or
         ``~/$XDG_CACHE_HOME/$appname/$version``
        ZXDG_CACHE_HOMErz~/.cacherrrrr
�user_cache_dirUszUnix.user_cache_dircCs,tj�dd�}|��s"tj�d�}|�|�S)z�
        :return: state directory tied to the user, e.g. ``~/.local/state/$appname/$version`` or
         ``$XDG_STATE_HOME/$appname/$version``
        ZXDG_STATE_HOMErz~/.local/staterrrrr
�user_state_dir`szUnix.user_state_dircCs|j}|jrtj�|d�}|S)zx
        :return: log directory tied to the user, same as `user_data_dir` if not opinionated else ``log`` in it
        �log)r*Zopinionrrr&rrrr
�user_log_dirkszUnix.user_log_dircCs6td�}|dur2tj�dd���}|s2tj�d�}|S)zU
        :return: documents directory tied to the user, e.g. ``~/Documents``
        ZXDG_DOCUMENTS_DIRNrz~/Documents)�_get_user_dirs_folderrrrrrr)rZ
documents_dirrrr
�user_documents_diruszUnix.user_documents_dircCs,tj�dd�}|��s"dt���}|�|�S)z�
        :return: runtime directory tied to the user, e.g. ``/run/user/$(id -u)/$appname/$version`` or
         ``$XDG_RUNTIME_DIR/$appname/$version``
        ZXDG_RUNTIME_DIRrz
/run/user/)rrrrrrrrrr
�user_runtime_dir�szUnix.user_runtime_dirrcCs|�|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_multipathrr!rrr
�site_data_path�szUnix.site_data_pathcCs|�|j�S)zj:return: config path shared by the users. Only return first item, even if ``multipath`` is set to ``True``)r1r)r!rrr
�site_config_path�szUnix.site_config_path)�	directoryr
cCs|jr|�tj�d}t|�S)Nr)r%r$rrr)rr4rrr
r1�sz%Unix._first_item_as_path_if_multipathN)�__name__�
__module__�__qualname__�__doc__�propertyrrrr(r)r*r+r-r/r0r2r3r1rrrr
rs2



	
rrz
str | None)�keyr
cCs�tj�t�jd�}tj�|�r�t�}t|��$}|�d|�	����Wd�n1sV0Y||dvrpdS|d|�
d�}|�dtj�d��}|SdS)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�~)
rrr&rr(�existsr�openZread_string�readr�replacer)r:Zuser_dirs_config_path�parser�streamrrrr
r.�s
2r.)Z
__future__rr�sysZconfigparserr�pathlibrZapir�platform�
startswithrrr.�__all__rrrr
�<module>s
�