Viewing File: /opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/cache.pyo

ó
“tÆ_c@sÙdZddlZddlmZddlmZddlmZddlm	Z	ddl
mZm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/python35/lib/python3.5/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/python35/lib/python3.5/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.
    cCs tt|ƒjƒ||_dS(N(tsuperRt__init__t	directory(tselfR((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/cache.pyR*scCs<tj|ƒ}t|d ƒ|g}tjj|j|ŒS(Ni(RtencodetlisttostpathtjoinR(Rtnamethashedtparts((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/cache.pyt_get_cache_path0sc	CsE|j|ƒ}tƒ't|dƒ}|jƒSWdQXWdQXdS(Ntrb(RRtopentread(RtkeyRtf((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/cache.pytget9s
c
Csk|j|ƒ}tƒMttjj|ƒƒt|ƒ}|j|ƒWdQXt|j	|ƒWdQXdS(N(
RRRRRtdirnameRtwriteRR(RR#tvalueRR$((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/cache.pytset@s
cCs0|j|ƒ}tƒtj|ƒWdQXdS(N(RRRtremove(RR#R((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/cache.pytdeleteKs
(t__name__t
__module__t__doc__RRR%R)R+(((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/cache.pyR$s					(R.Rt
contextlibRtpip._vendor.cachecontrol.cacheRtpip._vendor.cachecontrol.cachesRtpip._vendor.requests.modelsRtpip._internal.utils.filesystemRRtpip._internal.utils.miscRtpip._internal.utils.typingRttypingRR	RRR(((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/cache.pyt<module>s	
Back to Directory File Manager