![]() |
Qucs-S S-parameter Viewer & RF Synthesis Tools
|


Public Member Functions | |
| None | __init__ (self, str directory) |
| Optional[bytes] | get (self, str key) |
| None | set (self, str key, bytes value, Union[int, datetime, None] expires=None) |
| None | delete (self, str key) |
| Optional[BinaryIO] | get_body (self, str key) |
| None | set_body (self, str key, bytes body) |
Public Member Functions inherited from pip._vendor.cachecontrol.cache.BaseCache | |
| None | close (self) |
Public Attributes | |
| directory | |
Protected Member Functions | |
| str | _get_cache_path (self, str name) |
| None | _write (self, str path, bytes data) |
A file based cache which is safe to use even when the target directory may not be accessible or writable. There is a race condition when two processes try to write and/or read the same entry at the same time, since each entry consists of two separate files (https://github.com/psf/cachecontrol/issues/324). We therefore have additional logic that makes sure that both files to be present before returning an entry; this fixes the read side of the race condition. For the write side, we assume that the server will only ever return the same data for the same URL, which ought to be the case for files pip is downloading. PyPI does not have a mechanism to swap out a wheel for another wheel, for example. If this assumption is not true, the CacheControl issue will need to be fixed.
| None pip._internal.network.cache.SafeFileCache.delete | ( | self, | |
| str | key | ||
| ) |
Reimplemented from pip._vendor.cachecontrol.cache.BaseCache.
| Optional[bytes] pip._internal.network.cache.SafeFileCache.get | ( | self, | |
| str | key | ||
| ) |
Reimplemented from pip._vendor.cachecontrol.cache.BaseCache.
| Optional[BinaryIO] pip._internal.network.cache.SafeFileCache.get_body | ( | self, | |
| str | key | ||
| ) |
Return the body as file-like object.
Reimplemented from pip._vendor.cachecontrol.cache.SeparateBodyBaseCache.
| None pip._internal.network.cache.SafeFileCache.set | ( | self, | |
| str | key, | ||
| bytes | value, | ||
| Union[int, datetime, None] | expires = None |
||
| ) |
Reimplemented from pip._vendor.cachecontrol.cache.BaseCache.
| None pip._internal.network.cache.SafeFileCache.set_body | ( | self, | |
| str | key, | ||
| bytes | body | ||
| ) |
Reimplemented from pip._vendor.cachecontrol.cache.SeparateBodyBaseCache.