Viewing File: /opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/cachecontrol/caches/file_cache.pyc

ó
“tĆ_c@sœddlZddlZddlmZddlmZddlmZyeWne	k
roe
efZnXd„Zdefd„ƒYZ
d	„ZdS(
i˙˙˙˙N(tdedenti(t	BaseCache(tCacheControllercCsÍtj}|tjtjBO}ttdƒr<|tjO}nttdƒr[|tjO}nytj|ƒWntt	fk
r…nXtj
|||ƒ}ytj|dƒSWntj|ƒ‚nXdS(Nt
O_NOFOLLOWtO_BINARYtwb(
tostO_WRONLYtO_CREATtO_EXCLthasattrRRtremovetIOErrortOSErrortopentfdopentclose(tfilenametfmodetflagstfd((s[/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/cachecontrol/caches/file_cache.pyt_secure_open_writes 	
t	FileCachecBsSeZeddddd„Zed„ƒZd„Zd„Zd„Z	d„Z
RS(	i€iŔc
CsĚ|dk	r'|dk	r'tdƒ‚ny$ddlm}ddlm}Wn)tk
rvtdƒ}	t|	ƒ‚n%X|r†|}n|dkr›|}n||_||_	||_
||_||_dS(Ns/Cannot use use_dir_lock and lock_class togetheri˙˙˙˙(tLockFile(t
MkdirLockFilesŞ
            NOTE: In order to use the FileCache you must have
            lockfile installed. You can install it via pip:
              pip install lockfile
            (
tNonet
ValueErrortlockfileRtlockfile.mkdirlockfileRtImportErrorRt	directorytforevertfilemodetdirmodet
lock_class(
tselfRRR R!tuse_dir_lockR"RRtnotice((s[/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/cachecontrol/caches/file_cache.pyt__init__:s$

							cCstj|jƒƒjƒS(N(thashlibtsha224tencodet	hexdigest(tx((s[/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/cachecontrol/caches/file_cache.pyR)ascCs<|j|ƒ}t|d ƒ|g}tjj|j|ŒS(Ni(R)tlistRtpathtjoinR(R#tnamethashedtparts((s[/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/cachecontrol/caches/file_cache.pyt_fnescCsN|j|ƒ}y&t|dƒ}|jƒSWdQXWntk
rIdSXdS(Ntrb(R2RtreadtFileNotFoundErrorR(R#tkeyR/tfh((s[/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/cachecontrol/caches/file_cache.pytgetls
c
Cs“|j|ƒ}y#tjtjj|ƒ|jƒWnttfk
rKnX|j|ƒ2}t	|j|j
ƒ}|j|ƒWdQXWdQXdS(N(R2RtmakedirsR-tdirnameR!RR
R"RR twrite(R#R6tvalueR/tlockR7((s[/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/cachecontrol/caches/file_cache.pytsetus#cCsD|j|ƒ}|js@ytj|ƒWq@tk
r<q@XndS(N(R2RRRR5(R#R6R/((s[/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/cachecontrol/caches/file_cache.pytdeleteƒs	
N(t__name__t
__module__tFalseRR&tstaticmethodR)R2R8R>R?(((s[/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/cachecontrol/caches/file_cache.pyR8s 				cCstj|ƒ}|j|ƒS(s\Return the file cache path based on the URL.

    This does not ensure the file exists!
    (Rt	cache_urlR2(turlt	filecacheR6((s[/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/cachecontrol/caches/file_cache.pyturl_to_file_pathŒs(R'RttextwrapRtcacheRt
controllerRR5t	NameErrorRR
RRRG(((s[/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/cachecontrol/caches/file_cache.pyt<module>s
	)T
Back to Directory File Manager