ok

Mini Shell

Direktori : /opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/cachecontrol/caches/
Upload File :
Current File : //opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/cachecontrol/caches/file_cache.pyc

�
Bu�_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/python36/lib/python3.6/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/python36/lib/python3.6/site-packages/pip/_vendor/cachecontrol/caches/file_cache.pyt__init__:s$

							cCstj|j��j�S(N(thashlibtsha224tencodet	hexdigest(tx((s[/opt/alt/python36/lib/python3.6/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/python36/lib/python3.6/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/python36/lib/python3.6/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/python36/lib/python3.6/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/python36/lib/python3.6/site-packages/pip/_vendor/cachecontrol/caches/file_cache.pytdelete�s	
N(t__name__t
__module__tFalseRR&tstaticmethodR)R2R8R>R?(((s[/opt/alt/python36/lib/python3.6/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/python36/lib/python3.6/site-packages/pip/_vendor/cachecontrol/caches/file_cache.pyturl_to_file_path�s(R'RttextwrapRtcacheRt
controllerRR5t	NameErrorRR
RRRG(((s[/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/cachecontrol/caches/file_cache.pyt<module>s
	)T

Zerion Mini Shell 1.0