404

[ Avaa Bypassed ]




Upload:

Command:

botdev@3.147.75.131: ~ $
"""
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.
"""

from __future__ import absolute_import

import os

from pip._vendor import appdirs as _appdirs

from pip._internal.utils.typing import MYPY_CHECK_RUNNING

if MYPY_CHECK_RUNNING:
    from typing import List


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


def user_config_dir(appname, roaming=True):
    # type: (str, bool) -> str
    path = _appdirs.user_config_dir(appname, appauthor=False, roaming=roaming)
    if _appdirs.system == "darwin" and not os.path.isdir(path):
        path = os.path.expanduser('~/.config/')
        if appname:
            path = os.path.join(path, appname)
    return path


# for the discussion regarding site_config_dir locations
# see <https://github.com/pypa/pip/issues/1733>
def site_config_dirs(appname):
    # type: (str) -> List[str]
    dirval = _appdirs.site_config_dir(appname, appauthor=False, multipath=True)
    if _appdirs.system not in ["win32", "darwin"]:
        # always look in /etc directly as well
        return dirval.split(os.pathsep) + ['/etc']
    return [dirval]

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 2755
__init__.py File 0 B 0644
appdirs.py File 1.32 KB 0644
compat.py File 9.27 KB 0644
compatibility_tags.py File 5.31 KB 0644
datetime.py File 295 B 0644
deprecation.py File 3.24 KB 0644
direct_url_helpers.py File 4.26 KB 0644
distutils_args.py File 1.32 KB 0644
encoding.py File 1.25 KB 0644
entrypoints.py File 1.13 KB 0644
filesystem.py File 6.78 KB 0644
filetypes.py File 571 B 0644
glibc.py File 3.22 KB 0644
hashes.py File 4.57 KB 0644
inject_securetransport.py File 810 B 0644
logging.py File 12.79 KB 0644
misc.py File 27.34 KB 0644
models.py File 1.17 KB 0644
packaging.py File 2.96 KB 0644
parallel.py File 3.32 KB 0644
pkg_resources.py File 1.22 KB 0644
setuptools_build.py File 4.94 KB 0644
subprocess.py File 9.69 KB 0644
temp_dir.py File 8.18 KB 0644
typing.py File 1.37 KB 0644
unpacking.py File 9.27 KB 0644
urls.py File 1.49 KB 0644
virtualenv.py File 3.62 KB 0644
wheel.py File 7.13 KB 0644