Current File : //lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.pyc
�
r2Wc@sfddlZddlmZddlmZddlmZddlmZdefd��YZ	dS(	i����N(tHTTPAdapteri(tCacheController(t	DictCache(tCallbackFileWrappertCacheControlAdaptercBsPeZeddg�Zdedddd�Zd�Zed�Z	d�Z
RS(tPUTtDELETEc	Osbtt|�j||�|p%t�|_||_|p=t}||jd|d|�|_dS(Ntcache_etagst
serializer(tsuperRt__init__Rtcachet	heuristicRt
controller(	tselfRRtcontroller_classRRtargstkwtcontroller_factory((sD/usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.pyR

s		cKs{|jdkr\|jj|�}|r=|j||dt�S|jj|jj|��ntt	|�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.
        tGETt
from_cache(tmethodR
tcached_requesttbuild_responsetTruetheaderstupdatetconditional_headersR	Rtsend(RtrequestRtcached_responsetresp((sD/usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.pyRs	cCsM|r�|jdkr�|jdkrr|jj||�}||k	rOt}n|jdt�|j�|}q�|jdkr�|jj||�q�|j	r�|j	j
|�}nt|jt
j|jj||��|_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
        Ri0tdecode_contenti-(RtstatusR
tupdate_cached_responseRtreadtFalsetrelease_conntcache_responseRtapplyRt_fpt	functoolstpartialR	RRtinvalidating_methodstokt	cache_urlturlRtdeleteR(RRtresponseRRRR-((sD/usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.pyR2s4		
				cCs$|jj�tt|�j�dS(N(RtcloseR	R(R((sD/usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.pyR1ss
N(t__name__t
__module__tsetR+tNoneRR
RR$RR1(((sD/usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.pyR
s
	A(
R)tpip._vendor.requests.adaptersRR
RRRtfilewrapperRR(((sD/usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.pyt<module>s