/usr/local/lib/python3.6/site-packages/platformdirs/__pycache__
NameSizeModeActions
android.cpython-36.pyc43120644editdlrm
api.cpython-36.pyc52030644editdlrm
macos.cpython-36.pyc32540644editdlrm
unix.cpython-36.pyc70540644editdlrm
version.cpython-36.pyc2600644editdlrm
windows.cpython-36.pyc63840644editdlrm
__init__.cpython-36.pyc112350644editdlrm
__main__.cpython-36.pyc11810644editdlrm
Edit: /usr/local/lib/python3.6/site-packages/platformdirs/__pycache__/unix.cpython-36.pyc (7054B)
3 0Dg@sddlZddlZddlmZddlmZddlmZddlm Z ej j drZddlm Z ne d d d Z Gd d d e ZeeedddZd gZdS)N) ConfigParser)Path)Optional)PlatformDirsABClinux)getuid)returncCs tddS)Nzshould only be used on Linux) RuntimeErrorr r ;/usr/local/lib/python3.6/site-packages/platformdirs/unix.pyr src@seZdZdZeedddZeedddZeeddd Zeedd d Z eedd d Z eedddZ eedddZ eedddZ eedddZeedddZeedddZeedddZeedddZdS) 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 `. )r cCs,tjjdd}|js"tjjd}|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/share)osenvirongetstrippath expanduser_append_app_name_and_version)selfrr r r user_data_dirs zUnix.user_data_dircCs.tjjdd}|js$dtjd}|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_path)rrr r r site_data_dir(szUnix.site_data_dir)rr cs<|jtj}js|dd}fdd|D}tjj|S)Nrrcsg|]}jtjj|qSr )rrrr).0p)rr r 9sz)Unix._with_multi_path..)splitrr multipathjoin)rr path_listr )rr r5s   zUnix._with_multi_pathcCs,tjjdd}|js"tjjd}|j|S)z :return: config directory tied to the user, e.g. ``~/.config/$appname/$version`` or ``$XDG_CONFIG_HOME/$appname/$version`` XDG_CONFIG_HOMErz ~/.config)rrrrrrr)rrr r r user_config_dir<s zUnix.user_config_dircCs$tjjdd}|jsd}|j|S)a/ :return: config 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. ``/etc/xdg/$appname/$version`` XDG_CONFIG_DIRSrz/etc/xdg)rrrrr)rrr r r site_config_dirGszUnix.site_config_dircCs,tjjdd}|js"tjjd}|j|S)z :return: cache directory tied to the user, e.g. ``~/.cache/$appname/$version`` or ``~/$XDG_CACHE_HOME/$appname/$version`` XDG_CACHE_HOMErz~/.cache)rrrrrrr)rrr r r user_cache_dirTs zUnix.user_cache_dircCs,tjjdd}|js"tjjd}|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/state)rrrrrrr)rrr r r user_state_dir_s zUnix.user_state_dircCs|j}|jrtjj|d}|S)zx :return: log directory tied to the user, same as `user_data_dir` if not opinionated else ``log`` in it log)r)opinionrrr")rrr r r user_log_dirjszUnix.user_log_dircCs6td}|dkr2tjjddj}|s2tjjd}|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_dirts  zUnix.user_documents_dircCs,tjjdd}|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/)rrrrrr)rrr r r user_runtime_dirs zUnix.user_runtime_dircCs |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)rr r r site_data_pathszUnix.site_data_pathcCs |j|jS)zj:return: config path shared by the users. Only return first item, even if ``multipath`` is set to ``True``)r5r')rr r r site_config_pathszUnix.site_config_path) directoryr cCs|jr|jtjd}t|S)Nr)r!r rrr)rr8r r r r5sz%Unix._first_item_as_path_if_multipathN)__name__ __module__ __qualname____doc__propertystrrrrr%r'r)r+r.r2r4rr6r7r5r r r r r s2          r )keyr c Cstjjtjd}tjj|rt}t|}|jd|j WdQRX||dkr\dS|d|j d}|j dtjj d}|SdS)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"r r%existsropen read_stringreadrreplacer)r?user_dirs_config_pathparserstreamrr r r r0s   r0)rsys configparserrpathlibrtypingrapirplatform startswithrintr r>r0__all__r r r r s