1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
U
H=®dã@s\ddlZddlZddlZddlmZddlmZddlmZddl    m
Z
Gdd„deƒZ dS)    éN)Ú HTTPAdapteré)ÚCacheController)Ú    DictCache)ÚCallbackFileWrappercsNeZdZddhZd‡fdd„    Zd‡fdd„    Zd‡fd
d „    Z‡fd d „Z‡ZS)ÚCacheControlAdapterÚPUTÚDELETENTc
sTtt|ƒj||Ž|dkr tƒn||_||_|p2d|_|p<t}    |    |j||d|_dS)N)ÚGET)Ú cache_etagsÚ
serializer)    ÚsuperrÚ__init__rÚcacheÚ    heuristicÚcacheable_methodsrÚ
controller)
Úselfrr Úcontroller_classr rrÚargsÚkwÚcontroller_factory©Ú    __class__©úWD:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\pip/_vendor/cachecontrol/adapter.pyrs 
ÿzCacheControlAdapter.__init__c s€|p|j}|j|krhz|j |¡}Wntjk
r>d}YnX|rT|j||ddS|j |j     |¡¡t
t |ƒj |f|Ž}|S)z”
        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.
        NT)Ú
from_cache) rÚmethodrÚcached_requestÚzlibÚerrorÚbuild_responseÚheadersÚupdateÚconditional_headersr rÚsend)rÚrequestrrÚ    cacheableÚcached_responseÚresprrrr%$s
 
 
zCacheControlAdapter.sendFc
s|p|j}|sÄ|j|krÄ|jr*|j |¡}|jdkrh|j ||¡}||k    rNd}|jdd| ¡|}n\|jdkr‚|j     ||¡nBt
|j t   |jj    ||¡ƒ|_ |jrÄ|j‰‡fdd„}t ||¡|_tt|ƒ ||¡}|j|jkr|jr|j |j¡}    |j |    ¡||_|S)z¥
        Build a response by making a request or using the cache.
 
        This will end up calling send and returning a potentially
        cached response
        i0TF)Údecode_contenti-csˆƒ|jdkr|j ¡dS)Nr)Ú
chunk_leftÚ_fpÚ_close©r©Úsuper_update_chunk_lengthrrÚ_update_chunk_lengthns
z@CacheControlAdapter.build_response.<locals>._update_chunk_length)rrrÚapplyÚstatusrÚupdate_cached_responseÚreadÚ release_connÚcache_responserr,Ú    functoolsÚpartialÚchunkedr1ÚtypesÚ
MethodTyper rr!Úinvalidating_methodsÚokÚ    cache_urlÚurlrÚdeleter)
rr&Úresponserrr'r(r1r)r?rr/rr!9sJ    
 
ÿ 
ÿþ ÿ z"CacheControlAdapter.build_responsecs|j ¡tt|ƒ ¡dS)N)rÚcloser rr.rrrrCƒs
zCacheControlAdapter.close)NTNNNN)N)FN)    Ú__name__Ú
__module__Ú __qualname__r=rr%r!rCÚ __classcell__rrrrr sùÿJr) r;r8rZpip._vendor.requests.adaptersrrrrrÚ filewrapperrrrrrrÚ<module>s