1j) d Z ddlmZ ddlZddlZddlmZ ddlmZ ddl m
Z
mZ ddlm
Z
ej d k rddZndd
lmZ G d de
ZddZddZdgZdS )zUnix. )annotationsN)ConfigParser)Path)IteratorNoReturn )PlatformDirsABCwin32returnr c $ d} t | )Nzshould only be used on Unix)RuntimeError)msgs o/builddir/build/BUILD/cloudlinux-venv-1.0.11/venv/lib/python3.11/site-packages/pip/_vendor/platformdirs/unix.pygetuidr s +3 )r c " e Zd ZdZed!d Zed"d Zed!d Zed!d Zed"d Z ed!d
Z
ed!d Zed!d Zed!d
Z
ed!d Zed!d Zed!d Zed!d Zed!d Zed!d Zed!d Zed!d Zed!d Zed#d Zed#d Zed#d Zd$dZd%dZd%dZd S )&Unixa
On Unix/Linux, we follow the `XDG Basedir Spec `_.
The spec allows overriding directories with environment variables. The examples shown are the default values,
alongside the name of the environment variable that overrides them. Makes use of the `appname
`, `version `, `multipath
`, `opinion `, `ensure_exists
`.
r strc t j dd }| st j 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/shareosenvirongetstrippath
expanduser_append_app_name_and_versionselfr s r
user_data_dirzUnix.user_data_dir$ sS z~~or22zz|| 87%%&677D00666r list[str]c t j dd }| sdt j d} fd| t j D S )N
XDG_DATA_DIRSr z/usr/local/sharez
/usr/sharec : g | ]} | S r .0pr! s r
z(Unix._site_data_dirs..4 ' UUU11!44UUUr )r r r r pathsepsplitr s ` r _site_data_dirszUnix._site_data_dirs/ sb z~~or22zz|| =T>TUUUUr c l | j }| j s|d S t j | S )aZ
:return: data directories shared by users (if `multipath ` is
enabled and ``XDG_DATA_DIRS`` 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``
r )r0 multipathr r. joinr! dirss r
site_data_dirzUnix.site_data_dir6 s3 #~ 7Nzt$$$r c t j dd }| st j d }| | S )z
:return: config directory tied to the user, e.g. ``~/.config/$appname/$version`` or
``$XDG_CONFIG_HOME/$appname/$version``
XDG_CONFIG_HOMEr z ~/.configr r s r user_config_dirzUnix.user_config_dirC sS z~~/44zz|| 37%%k22D00666r c t j dd }| sd} fd| t j D S )NXDG_CONFIG_DIRSr z/etc/xdgc : g | ]} | S r' r( r) s r r, z*Unix._site_config_dirs..S r- r )r r r r r/ r. r s ` r _site_config_dirszUnix._site_config_dirsN sV z~~/44zz|| DUUUUdjj>T>TUUUUr c l | j }| j s|d S t j | S )a2
:return: config directories shared by users (if `multipath `
is enabled and ``XDG_CONFIG_DIRS`` 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``
r )r= r2 r r. r3 r4 s r site_config_dirzUnix.site_config_dirU s3 %~ 7Nzt$$$r c t j dd }| st j d }| | S )z
:return: cache directory tied to the user, e.g. ``~/.cache/$appname/$version`` or
``~/$XDG_CACHE_HOME/$appname/$version``
XDG_CACHE_HOMEr z~/.cacher r s r user_cache_dirzUnix.user_cache_dirb sS z~~.33zz|| 27%%j11D00666r c , | d S )zO:return: cache directory shared by users, e.g. ``/var/cache/$appname/$version``z
/var/cacher( r! s r site_cache_dirzUnix.site_cache_dirm s 00>>>r c t j dd }| st j d }| | S )z
:return: state directory tied to the user, e.g. ``~/.local/state/$appname/$version`` or
``$XDG_STATE_HOME/$appname/$version``
XDG_STATE_HOMEr z~/.local/stater r s r user_state_dirzUnix.user_state_dirr sT z~~.33zz|| 87%%&677D00666r c | j }| j r5t j |d }| | |S )zg:return: log directory tied to the user, same as `user_state_dir` if not opinionated else ``log`` in itlog)rH opinionr r r3 _optionally_create_directoryr s r user_log_dirzUnix.user_log_dir} sD "<