VULN_CHECK_I913V6 SShddlmZddlZddlZddlmZddlmZddlm Z ejjdrddlm Z nd d Z Gd d e Z dd Zd gZy)) annotationsN) ConfigParser)Path)PlatformDirsABClinux)getuidctd)Nzshould only be used on Linux) RuntimeErrorL/usr/lib/python3.12/site-packages/pkg_resources/_vendor/platformdirs/unix.pyr r s9::r ceZdZdZeddZeddZddZeddZeddZ eddZ eddZ edd Z edd Z edd Zedd Zedd ZddZy)UnixaD On Unix/Linux, we follow the `XDG Basedir Spec `_. 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 `, `version `, `multipath `, `opinion `. ctjjdd}|jstjj d}|j |S)z :return: data directory tied to the user, e.g. ``~/.local/share/$appname/$version`` or ``$XDG_DATA_HOME/$appname/$version`` XDG_DATA_HOMEz~/.local/shareosenvirongetstrippath expanduser_append_app_name_and_versionselfrs r user_data_dirzUnix.user_data_dirsG zz~~or2zz|77%%&67D0066r ctjjdd}|jsdtjd}|j |S)aY :return: data directories shared by users (if `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)rrrrpathsep_with_multi_pathrs r site_data_dirzUnix.site_data_dir)sDzz~~or2zz|%bjj\` 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"rs rsite_config_dirzUnix.site_config_dirHs8zz~~/4zz|D$$T**r ctjjdd}|jstjj d}|j |S)z :return: cache directory tied to the user, e.g. ``~/.cache/$appname/$version`` or ``~/$XDG_CACHE_HOME/$appname/$version`` XDG_CACHE_HOMErz~/.cacherrs ruser_cache_dirzUnix.user_cache_dirUsG zz~~.3zz|77%%j1D0066r ctjjdd}|jstjj d}|j |S)z :return: state directory tied to the user, e.g. ``~/.local/state/$appname/$version`` or ``$XDG_STATE_HOME/$appname/$version`` XDG_STATE_HOMErz~/.local/staterrs ruser_state_dirzUnix.user_state_dir`sH zz~~.3zz|77%%&67D0066r cv|j}|jr tjj |d}|S)zy :return: log directory tied to the user, same as `user_state_dir` if not opinionated else ``log`` in it log)r5opinionrrr'rs r user_log_dirzUnix.user_log_dirks/ "" <<77<<e,D r ctd}|Otjjddj }|stj j d}|S)zU :return: documents directory tied to the user, e.g. ``~/Documents`` XDG_DOCUMENTS_DIRrz ~/Documents)_get_user_dirs_folderrrrrrr)r documents_dirs ruser_documents_dirzUnix.user_documents_dirusP ..AB  JJNN+>CIIKM " 2 2= A r ctjjdd}|js dt }|j |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/)rrrrr rrs ruser_runtime_dirzUnix.user_runtime_dirsA zz~~/4zz|z*D0066r c8|j|jS)zd:return: data path shared by users. Only return first item, even if ``multipath`` is set to ``True``) _first_item_as_path_if_multipathr#rs rsite_data_pathzUnix.site_data_paths44T5G5GHHr c8|j|jS)zj:return: config path shared by the users. Only return first item, even if ``multipath`` is set to ``True``)rCr/rDs rsite_config_pathzUnix.site_config_paths44T5I5IJJr ct|jr"|jtjd}t |S)Nr)r&r%rr!r)r directorys rrCz%Unix._first_item_as_path_if_multipaths* >>! 3A6IIr N)returnstr)rrKrJrK)rJr)rIrKrJr)__name__ __module__ __qualname____doc__propertyrr#r"r,r/r2r5r9r>rArErGrCr r rrrs 77 + +*77 + +7777  77IIKKr rctjjtjd}tjj |rt }t|5}|jd|jddd||dvry|d|jd}|jdtjjd}|Sy#1swYZxYw)zjReturn directory from user-dirs.dirs config file. See https://freedesktop.org/wiki/Software/xdg-user-dirs/zuser-dirs.dirsz[top] Ntop"z$HOME~) rrr'rr,existsropen read_stringreadrreplacer)keyuser_dirs_config_pathparserstreamrs rr<r<sGGLL)?)?AQR ww~~+, ' (F   8 9) fUm #e}S!'',||GRWW%7%7%<= ) (s '#C##C,)rJint)rZrKrJz str | None) __future__rrsys configparserrpathlibrapirplatform startswithr rr<__all__r r rrgsQ" % <<7#;I?IX,  r