Python pip._internal.locations.USER_CACHE_DIR Examples
The following are 6
code examples of pip._internal.locations.USER_CACHE_DIR().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
pip._internal.locations
, or try the search function
.
Example #1
Source File: core.py From pipenv with MIT License | 6 votes |
def do_clear(): click.echo(crayons.white(fix_utf8("Clearing caches…"), bold=True)) try: from pip._internal import locations except ImportError: # pip 9. from pip import locations try: vistir.path.rmtree(PIPENV_CACHE_DIR, onerror=vistir.path.handle_remove_readonly) # Other processes may be writing into this directory simultaneously. vistir.path.rmtree( locations.USER_CACHE_DIR, ignore_errors=environments.PIPENV_IS_CI, onerror=vistir.path.handle_remove_readonly ) except OSError as e: # Ignore FileNotFoundError. This is needed for Python 2.7. import errno if e.errno == errno.ENOENT: pass raise
Example #2
Source File: outdated.py From Python24 with MIT License | 5 votes |
def __init__(self): self.statefile_path = os.path.join(USER_CACHE_DIR, "selfcheck.json") # Load the existing state try: with open(self.statefile_path) as statefile: self.state = json.load(statefile)[sys.prefix] except (IOError, ValueError, KeyError): self.state = {}
Example #3
Source File: outdated.py From FuYiSpider with Apache License 2.0 | 5 votes |
def __init__(self): self.statefile_path = os.path.join(USER_CACHE_DIR, "selfcheck.json") # Load the existing state try: with open(self.statefile_path) as statefile: self.state = json.load(statefile)[sys.prefix] except (IOError, ValueError, KeyError): self.state = {}
Example #4
Source File: outdated.py From FuYiSpider with Apache License 2.0 | 5 votes |
def __init__(self): self.statefile_path = os.path.join(USER_CACHE_DIR, "selfcheck.json") # Load the existing state try: with open(self.statefile_path) as statefile: self.state = json.load(statefile)[sys.prefix] except (IOError, ValueError, KeyError): self.state = {}
Example #5
Source File: outdated.py From hacktoberfest2018 with GNU General Public License v3.0 | 5 votes |
def __init__(self): self.statefile_path = os.path.join(USER_CACHE_DIR, "selfcheck.json") # Load the existing state try: with open(self.statefile_path) as statefile: self.state = json.load(statefile)[sys.prefix] except (IOError, ValueError, KeyError): self.state = {}
Example #6
Source File: outdated.py From hacktoberfest2018 with GNU General Public License v3.0 | 5 votes |
def __init__(self): self.statefile_path = os.path.join(USER_CACHE_DIR, "selfcheck.json") # Load the existing state try: with open(self.statefile_path) as statefile: self.state = json.load(statefile)[sys.prefix] except (IOError, ValueError, KeyError): self.state = {}