Mercurial > repos > guerler > hhblits
comparison lib/python3.8/site-packages/pip/_internal/utils/appdirs.py @ 0:9e54283cc701 draft
"planemo upload commit d12c32a45bcd441307e632fca6d9af7d60289d44"
author | guerler |
---|---|
date | Mon, 27 Jul 2020 03:47:31 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:9e54283cc701 |
---|---|
1 """ | |
2 This code wraps the vendored appdirs module to so the return values are | |
3 compatible for the current pip code base. | |
4 | |
5 The intention is to rewrite current usages gradually, keeping the tests pass, | |
6 and eventually drop this after all usages are changed. | |
7 """ | |
8 | |
9 from __future__ import absolute_import | |
10 | |
11 import os | |
12 | |
13 from pip._vendor import appdirs as _appdirs | |
14 | |
15 from pip._internal.utils.typing import MYPY_CHECK_RUNNING | |
16 | |
17 if MYPY_CHECK_RUNNING: | |
18 from typing import List | |
19 | |
20 | |
21 def user_cache_dir(appname): | |
22 # type: (str) -> str | |
23 return _appdirs.user_cache_dir(appname, appauthor=False) | |
24 | |
25 | |
26 def user_config_dir(appname, roaming=True): | |
27 # type: (str, bool) -> str | |
28 return _appdirs.user_config_dir(appname, appauthor=False, roaming=roaming) | |
29 | |
30 | |
31 def user_data_dir(appname, roaming=False): | |
32 # type: (str, bool) -> str | |
33 return _appdirs.user_data_dir(appname, appauthor=False, roaming=roaming) | |
34 | |
35 | |
36 def site_config_dirs(appname): | |
37 # type: (str) -> List[str] | |
38 dirval = _appdirs.site_config_dir(appname, appauthor=False, multipath=True) | |
39 if _appdirs.system not in ["win32", "darwin"]: | |
40 return dirval.split(os.pathsep) | |
41 return [dirval] |