zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
U
H=®d    ã@s dZddlZddlmZddlmZddlmZddlm    Z    ddl
m Z m Z ddl mZdd    lmZerxdd
lmZmZd d „Zed d„ƒZGdd„deƒZdS)zHTTP cache implementation.
éN)Úcontextmanager)Ú    BaseCache)Ú    FileCache)ÚResponse)Úadjacent_tmp_fileÚreplace)Ú
ensure_dir)ÚMYPY_CHECK_RUNNING)ÚOptionalÚIteratorcCs t|ddƒS)NÚ
from_cacheF)Úgetattr)Úresponse©rúRD:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\pip/_internal/network/cache.pyÚ is_from_cachesrc    cs(z
dVWnttfk
r"YnXdS)zvIf we can't access the cache then we can just skip caching and process
    requests as if caching wasn't enabled.
    N)ÚOSErrorÚIOErrorrrrrÚsuppressed_cache_errorss
rcs@eZdZdZ‡fdd„Zdd„Zdd„Zdd    „Zd
d „Z‡Z    S) Ú SafeFileCachezw
    A file based cache which is safe to use even when the target directory may
    not be accessible or writable.
    cs(|dk    stdƒ‚tt|ƒ ¡||_dS)Nz!Cache directory must not be None.)ÚAssertionErrorÚsuperrÚ__init__Ú    directory)Úselfr©Ú    __class__rrr*szSafeFileCache.__init__cCs4t |¡}t|dd…ƒ|g}tjj|jf|žŽS)Né)rÚencodeÚlistÚosÚpathÚjoinr)rÚnameÚhashedÚpartsrrrÚ_get_cache_path0s
zSafeFileCache._get_cache_pathc CsR| |¡}tƒ8t|dƒ"}| ¡W5QR£W5QR£SQRXW5QRXdS)NÚrb)r&rÚopenÚread)rÚkeyr!ÚfrrrÚget9s
 zSafeFileCache.getc
CsZ| |¡}tƒ@ttj |¡ƒt|ƒ}| |¡W5QRXt|j    |ƒW5QRXdS©N)
r&rrr r!ÚdirnamerÚwriterr#)rr*Úvaluer!r+rrrÚset@s 
 
zSafeFileCache.setc    Cs*| |¡}tƒt |¡W5QRXdSr-)r&rr Úremove)rr*r!rrrÚdeleteKs
zSafeFileCache.delete)
Ú__name__Ú
__module__Ú __qualname__Ú__doc__rr&r,r1r3Ú __classcell__rrrrr$s       r)r7r Ú
contextlibrZpip._vendor.cachecontrol.cacherÚpip._vendor.cachecontrol.cachesrZpip._vendor.requests.modelsrÚpip._internal.utils.filesystemrrÚpip._internal.utils.miscrÚpip._internal.utils.typingr    Útypingr
r rrrrrrrÚ<module>s