https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/platformdirs/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/platformdirs/__pycache__/unix.cpython-310.pyc
o

�1b��@s�ddlmZddlZddlZddlmZddlmZddlm	Z	ej
�d�r-ddlmZnddd�ZGd
d�de	�Z
ddd�ZdgZdS)�)�annotationsN)�ConfigParser)�Path�)�PlatformDirsABC�linux)�getuid�return�intcCstd��)Nzshould only be used on Linux)�RuntimeError�rr�3/usr/lib/python3/dist-packages/platformdirs/unix.pyrsrc@s�eZdZdZed"dd��Zed"dd��Zd#d	d
�Zed"dd��Zed"d
d��Z	ed"dd��Z
ed"dd��Zed"dd��Zed"dd��Z
ed"dd��Zed$dd��Zed$dd��Zd%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>`.
    r	�strcC�,tj�dd�}|��stj�d�}|�|�S)z�
        :return: data directory tied to the user, e.g. ``~/.local/share/$appname/$version`` or
         ``$XDG_DATA_HOME/$appname/$version``
        �
XDG_DATA_HOME�z~/.local/share��os�environ�get�strip�path�
expanduser�_append_app_name_and_version��selfrrrr
�
user_data_dir�
zUnix.user_data_dircCs.tj�dd�}|��sdtj�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``
        �
XDG_DATA_DIRSrz/usr/local/sharez
/usr/share)rrrr�pathsep�_with_multi_pathrrrr
�
site_data_dir)s
zUnix.site_data_dirrcs<|�tj�}�js|dd�}�fdd�|D�}tj�|�S)Nrrcsg|]}��tj�|���qSr)rrrr)�.0�p�rrr
�
<listcomp>:sz)Unix._with_multi_path.<locals>.<listcomp>)�splitrr �	multipath�join)rr�	path_listrr%r
r!6s
zUnix._with_multi_pathcCr)z�
        :return: config directory tied to the user, e.g. ``~/.config/$appname/$version`` or
         ``$XDG_CONFIG_HOME/$appname/$version``
        �XDG_CONFIG_HOMErz	~/.configrrrrr
�user_config_dir=rzUnix.user_config_dircCs$tj�dd�}|��s
d}|�|�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``
        �XDG_CONFIG_DIRSrz/etc/xdg)rrrrr!rrrr
�site_config_dirHs
zUnix.site_config_dircCr)z�
        :return: cache directory tied to the user, e.g. ``~/.cache/$appname/$version`` or
         ``~/$XDG_CACHE_HOME/$appname/$version``
        �XDG_CACHE_HOMErz~/.cacherrrrr
�user_cache_dirUrzUnix.user_cache_dircCr)z�
        :return: state directory tied to the user, e.g. ``~/.local/state/$appname/$version`` or
         ``$XDG_STATE_HOME/$appname/$version``
        �XDG_STATE_HOMErz~/.local/staterrrrr
�user_state_dir`rzUnix.user_state_dircCs|j}|jr
tj�|d�}|S)zx
        :return: log directory tied to the user, same as `user_data_dir` if not opinionated else ``log`` in it
        �log)r0�opinionrrr)rrrr
�user_log_dirkszUnix.user_log_dircCs6td�}|durtj�dd���}|stj�d�}|S)zU
        :return: documents directory tied to the user, e.g. ``~/Documents``
        �XDG_DOCUMENTS_DIRNrz~/Documents)�_get_user_dirs_folderrrrrrr)r�
documents_dirrrr
�user_documents_diruszUnix.user_documents_dircCs,tj�dd�}|��sdt���}|�|�S)z�
        :return: runtime directory tied to the user, e.g. ``/run/user/$(id -u)/$appname/$version`` or
         ``$XDG_RUNTIME_DIR/$appname/$version``
        �XDG_RUNTIME_DIRrz
/run/user/)rrrrrrrrrr
�user_runtime_dir�rzUnix.user_runtime_dirrcC�|�|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_multipathr"r%rrr
�site_data_path��zUnix.site_data_pathcCr<)zj:return: config path shared by the users. Only return first item, even if ``multipath`` is set to ``True``)r=r.r%rrr
�site_config_path�r?zUnix.site_config_path�	directorycCs|jr|�tj�d}t|�S)Nr)r(r'rr r)rrArrr
r=�sz%Unix._first_item_as_path_if_multipathN)r	r)rrr	r)r	r)rArr	r)�__name__�
__module__�__qualname__�__doc__�propertyrr"r!r,r.r0r2r5r9r;r>r@r=rrrr
rs4




	
r�keyr�
str | NonecCs�tj�t�jd�}tj�|�rMt�}t|��}|�d|�	����Wd�n1s+wY||dvr8dS|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�open�read_string�readr�replacer)rG�user_dirs_config_path�parser�streamrrrr
r7�s
�r7)r	r
)rGrr	rH)�
__future__rr�sys�configparserr�pathlibr�apir�platform�
startswithrrr7�__all__rrrr
�<module>s


�

https://t.me/RX1948 - 2025