Viewing File: /opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/cachecontrol/adapter.pyo

ó
“tÆ_c@s~ddlZddlZddlZddlmZddlmZddlmZddl	m
Z
defd„ƒYZdS(	iÿÿÿÿN(tHTTPAdapteri(tCacheController(t	DictCache(tCallbackFileWrappertCacheControlAdaptercBsSeZddhZdeddddd„Zdd„Zedd„Zd„Z	RS(tPUTtDELETEc
Os}tt|ƒj||Ž|dkr.tƒn||_||_|pId|_|pXt}	|	|jd|d|ƒ|_	dS(NtGETtcache_etagst
serializer(R(
tsuperRt__init__tNoneRtcachet	heuristictcacheable_methodsRt
controller(
tselfR
Rtcontroller_classR	RRtargstkwtcontroller_factory((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/cachecontrol/adapter.pyRs	cKs«|p|j}|j|krŒy|jj|ƒ}Wntjk
rPd}nX|rm|j||dtƒS|j	j
|jj|ƒƒntt
|ƒj||}|S(s”
        Send a request. Use the request information to see if it
        exists in the cache and cache the response if we need to and can.
        t
from_cacheN(RtmethodRtcached_requesttzlibterrorRtbuild_responsetTruetheaderstupdatetconditional_headersR
Rtsend(RtrequestRRt	cacheabletcached_responsetresp((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/cachecontrol/adapter.pyR $s
c
s•|p|j}|r*|j|kr*|jrC|jj|ƒ}n|jdkrŸ|jj||ƒ}||k	r|t}n|jdt	ƒ|j
ƒ|}q*|jdkrÄ|jj||ƒq*t|j
tj|jj||ƒƒ|_
|jr*|j‰‡fd†}tj||ƒ|_q*ntt|ƒj||ƒ}|j|jkrˆ|jrˆ|jj|jƒ}	|jj|	ƒn||_|S(s¥
        Build a response by making a request or using the cache.

        This will end up calling send and returning a potentially
        cached response
        i0tdecode_contenti-cs*ˆƒ|jdkr&|jjƒndS(Ni(t
chunk_leftt_fpt_close(R(tsuper_update_chunk_length(sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/cachecontrol/adapter.pyt_update_chunk_lengthns(RRRtapplytstatusRtupdate_cached_responseRtreadtFalsetrelease_conntcache_responseRR't	functoolstpartialtchunkedR*ttypest
MethodTypeR
RRtinvalidating_methodstokt	cache_urlturlR
tdeleteR(
RR!tresponseRRR"R#R*R$R9((R)sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/cachecontrol/adapter.pyR9s:				
				cCs$|jjƒtt|ƒjƒdS(N(R
tcloseR
R(R((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/cachecontrol/adapter.pyR=ƒs
N(
t__name__t
__module__R7RRRR R/RR=(((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/cachecontrol/adapter.pyRsI(R5R2Rtpip._vendor.requests.adaptersRRRR
RtfilewrapperRR(((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/cachecontrol/adapter.pyt<module>s
Back to Directory File Manager