ó vÆ_c@sÙdZddlZddlmZddlmZddlmZddlm Z ddl m Z m Z ddl mZdd lmZer§dd lmZmZnd „Zed „ƒZd efd„ƒYZdS(sHTTP cache implementation. iÿÿÿÿN(tcontextmanager(t BaseCache(t FileCache(tResponse(tadjacent_tmp_filetreplace(t ensure_dir(tMYPY_CHECK_RUNNING(tOptionaltIteratorcCst|dtƒS(Nt from_cache(tgetattrtFalse(tresponse((sL/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/network/cache.pyt is_from_cachesccs'y dVWnttfk r"nXdS(svIf we can't access the cache then we can just skip caching and process requests as if caching wasn't enabled. N(tOSErrortIOError(((sL/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/network/cache.pytsuppressed_cache_errorss t SafeFileCachecBs;eZdZd„Zd„Zd„Zd„Zd„ZRS(sw A file based cache which is safe to use even when the target directory may not be accessible or writable. cCs8|dk stdƒ‚tt|ƒjƒ||_dS(Ns!Cache directory must not be None.(tNonetAssertionErrortsuperRt__init__t directory(tselfR((sL/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/network/cache.pyR*scCs<tj|ƒ}t|d ƒ|g}tjj|j|ŒS(Ni(RtencodetlisttostpathtjoinR(Rtnamethashedtparts((sL/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/network/cache.pyt_get_cache_path0sc CsE|j|ƒ}tƒ't|dƒ}|jƒSWdQXWdQXdS(Ntrb(R!Rtopentread(RtkeyRtf((sL/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/network/cache.pytget9s c Csk|j|ƒ}tƒMttjj|ƒƒt|ƒ}|j|ƒWdQXt|j |ƒWdQXdS(N( R!RRRRtdirnameRtwriteRR(RR%tvalueRR&((sL/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/network/cache.pytset@s  cCs0|j|ƒ}tƒtj|ƒWdQXdS(N(R!RRtremove(RR%R((sL/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/network/cache.pytdeleteKs (t__name__t __module__t__doc__RR!R'R+R-(((sL/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/network/cache.pyR$s    (R0Rt contextlibRtpip._vendor.cachecontrol.cacheRtpip._vendor.cachecontrol.cachesRtpip._vendor.requests.modelsRtpip._internal.utils.filesystemRRtpip._internal.utils.miscRtpip._internal.utils.typingRttypingRR RRR(((sL/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/network/cache.pyts