[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.129.70.153: ~ $
"""
This code wraps the vendored appdirs module to so the return values are
compatible for the current pip code base.

The intention is to rewrite current usages gradually, keeping the tests pass,
and eventually drop this after all usages are changed.
"""

import os
import sys
from typing import List

from pip._vendor import platformdirs as _appdirs


def user_cache_dir(appname: str) -> str:
    return _appdirs.user_cache_dir(appname, appauthor=False)


def _macos_user_config_dir(appname: str, roaming: bool = True) -> str:
    # Use ~/Application Support/pip, if the directory exists.
    path = _appdirs.user_data_dir(appname, appauthor=False, roaming=roaming)
    if os.path.isdir(path):
        return path

    # Use a Linux-like ~/.config/pip, by default.
    linux_like_path = "~/.config/"
    if appname:
        linux_like_path = os.path.join(linux_like_path, appname)

    return os.path.expanduser(linux_like_path)


def user_config_dir(appname: str, roaming: bool = True) -> str:
    if sys.platform == "darwin":
        return _macos_user_config_dir(appname, roaming)

    return _appdirs.user_config_dir(appname, appauthor=False, roaming=roaming)


# for the discussion regarding site_config_dir locations
# see <https://github.com/pypa/pip/issues/1733>
def site_config_dirs(appname: str) -> List[str]:
    if sys.platform == "darwin":
        return [_appdirs.site_data_dir(appname, appauthor=False, multipath=True)]

    dirval = _appdirs.site_config_dir(appname, appauthor=False, multipath=True)
    if sys.platform == "win32":
        return [dirval]

    # Unix-y system. Look in /etc as well.
    return dirval.split(os.pathsep) + ["/etc"]

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
__init__.py File 0 B 0644
_jaraco_text.py File 3.27 KB 0644
_log.py File 1015 B 0644
appdirs.py File 1.63 KB 0644
compat.py File 2.34 KB 0644
compatibility_tags.py File 6.13 KB 0644
datetime.py File 242 B 0644
deprecation.py File 3.62 KB 0644
direct_url_helpers.py File 3.12 KB 0644
egg_link.py File 2.41 KB 0644
encoding.py File 1.14 KB 0644
entrypoints.py File 2.99 KB 0644
filesystem.py File 4.83 KB 0644
filetypes.py File 716 B 0644
glibc.py File 3.65 KB 0644
hashes.py File 4.86 KB 0644
logging.py File 11.33 KB 0644
misc.py File 22.98 KB 0644
packaging.py File 2.06 KB 0644
retry.py File 1.36 KB 0644
setuptools_build.py File 4.33 KB 0644
subprocess.py File 8.78 KB 0644
temp_dir.py File 9.09 KB 0644
unpacking.py File 11.67 KB 0644
urls.py File 1.56 KB 0644
virtualenv.py File 3.38 KB 0644
wheel.py File 4.39 KB 0644