\hi"dZddlmZddlZddlZddlmZddlmZddl m Z ejdk(rdd Z ndd lm Z Gd d e Z dd ZddZd gZy)zUnix.) annotationsN) ConfigParser)Path)PlatformDirsABCwin32cd}t|)Nzshould only be used on Unix) RuntimeError)msgs `/root/niggaflix-v3/playground/venv/lib/python3.12/site-packages/pip/_vendor/platformdirs/unix.pygetuidr s+3)r cReZdZdZeddZeddZddZeddZeddZ eddZ eddZ edd Z edd Z edd Zedd Zedd ZeddZeddZeddZeddZeddZeddZddZy)Unixa 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 `, `ensure_exists `. 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_dir"sG zz~~or2zz|77%%&67D0066rctjjdd}|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 r site_config_dirzUnix.site_config_dirLs8zz~~/4zz|D$$T**rctjjdd}|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 r user_cache_dirzUnix.user_cache_dirYsG zz~~.3zz|77%%j1D0066rc$|jdS)zM:return: cache directory shared by users, e.g. ``/var/tmp/$appname/$version``z/var/tmp)rrs r site_cache_dirzUnix.site_cache_dirds00<>rcDtjjdd}|js`tj j dr4dt}t|jsdt}n dt}|j|S)az :return: runtime directory tied to the user, e.g. ``/run/user/$(id -u)/$appname/$version`` or ``$XDG_RUNTIME_DIR/$appname/$version``. For FreeBSD/OpenBSD/NetBSD, it would return ``/var/run/user/$(id -u)/$appname/$version`` if exists, otherwise ``/tmp/runtime-$(id -u)/$appname/$version``, if``$XDG_RUNTIME_DIR`` is not set. XDG_RUNTIME_DIRr)freebsdopenbsdnetbsdz/var/run/user/z /tmp/runtime-z /run/user/) rrrrsysplatform startswithr rexistsrrs r user_runtime_dirzUnix.user_runtime_dirszz~~/4zz|||&&'GH'z2Dz((**68*5D#FH:.0066rc8|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#r4s r site_data_pathzUnix.site_data_paths44T5G5GHHrc8|j|jS)zj:return: config path shared by the users. Only return first item, even if ``multipath`` is set to ``True``)rYr/r4s r site_config_pathzUnix.site_config_paths44T5I5IJJrc8|j|jS)ze:return: cache path shared by users. Only return first item, even if ``multipath`` is set to ``True``)rYr5r4s r site_cache_pathzUnix.site_cache_paths44T5H5HIIrct|jr"|jtjd}t |S)Nr)r&r%rr!r)r directorys r rYz%Unix._first_item_as_path_if_multipaths* >>! 3A6IIrN)returnstr)rrbrarb)rar)r`rbrar)__name__ __module__ __qualname____doc__propertyrr#r"r,r/r2r5r8r<rArDrGrJrMrWrZr\r^rYrr rrss 77 + +*77 + +77==77GGFFEEAA??77&IIKKJJrrct|}|Otjj|dj }|stj j |}|S)Nr)_get_user_dirs_folderrrrrrr)env_varfallback_tilde_path media_dirs r r@r@sM%g.IJJNN7B/557 **+>?I rcttjdz }|jrt }|j 5}|j d|jddd||dvry|d|jd}|jdtjjdSy#1swYXxYw)zkReturn directory from user-dirs.dirs config file. See https://freedesktop.org/wiki/Software/xdg-user-dirs/.zuser-dirs.dirsz[top] Ntop"z$HOME~) rrr,rVropen read_stringreadrreplacerrr)keyuser_dirs_config_pathparserstreamrs r rjrjs !7!78;KK##% " ' ' ) :V   8 9 : fUm #e}S!'',||GRWW%7%7%<==  : :s #CC)raint)rkrbrlrbrarb)rvrbraz str | None)rf __future__rrrS configparserrpathlibrapirrTr rr@rj__all__rhrr rsU " % <<7 g?gT*  r