ó vÆ_c@s·dZddlZddlZddlZddlZddlmZddlmZddl m Z ddl m Z ej eƒZejdƒZd „Zd efd „ƒYZdS( s7 The httplib2 algorithms ported for use with requests. iÿÿÿÿN(t parsedate_tz(tCaseInsensitiveDicti(t DictCache(t Serializers9^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?cCs<tj|ƒjƒ}|d|d|d|d|dfS(s‡Parses a URI using the regex given in Appendix B of RFC 3986. (scheme, authority, path, query, fragment) = parse_uri(uri) iiiii(tURItmatchtgroups(turiR((sT/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/cachecontrol/controller.pyt parse_uristCacheControllercBsteZdZd ed d d„Zed„ƒZed„ƒZd„Z d„Z d„Z d d d„Z d„Z RS( s9An interface to see if request should cached or not. cCsL|dkrtƒn||_||_|p3tƒ|_|pBd|_dS(NiÈiËi,i-(iÈiËi,i-(tNoneRtcachet cache_etagsRt serializertcacheable_status_codes(tselfR R R t status_codes((sT/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/cachecontrol/controller.pyt__init__"s c Csšt|ƒ\}}}}}| s)| r<td|ƒ‚n|jƒ}|jƒ}|scd}n|r~dj||gƒp|}|d||}|S(s4Normalize the URL to create a safe key for the caches(Only absolute URIs are allowed. uri = %st/t?s://(Rt Exceptiontlowertjoin( tclsRtschemet authoritytpathtquerytfragmentt request_urit defrag_uri((sT/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/cachecontrol/controller.pyt_urlnorm*s   !cCs |j|ƒS(N(R(RR((sT/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/cachecontrol/controller.pyt cache_url>sc Csèi ttfd6ttfd6ttfd6dtfd6dtfd6dtfd6dtfd6dtfd6dtfd 6dtfd 6dtfd 6ttfd 6}|jd |jddƒƒ}i}x|jdƒD] }|jƒsîqÖn|jddƒ}|djƒ}y||\}} Wn$tk rJtj d|ƒqÖnX| sY| rfd|| %is4The cached response is "stale" with no etag, purgingN(R turlR-R.R;R2R(R R)R R tloadstwarningtstatusRtdeletettimetcalendarttimegmRtmax(RtrequestR tcct cache_datatresptmsgR2tnowR<t current_agetresp_cctfreshness_lifetimeR>t expire_timet min_fresh((sT/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/cachecontrol/controller.pytcached_requestxsv                          cCs|j|jƒ}|jj||jj|ƒƒ}i}|r‹t|jƒ}d|krk|d|d 0R>sCaching b/c of expires header(RRBR-R.RR2R tisdigitR&tlenR;R R?R(R'R R)RCR tsetR tdumps( RRHtresponseRYRRtresponse_headerstcc_reqRIR tno_store((sT/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/cachecontrol/controller.pytcache_response÷s^        " %   "    cs¤|j|jƒ}|jj||jj|ƒƒ}|s=|Sdg‰|jjt‡fd†|jj ƒDƒƒƒd|_ |jj ||jj ||ƒƒ|S(séOn a 304 we will get a new set of headers that we want to update our cached value with, assuming we have one. This should only ever be called when we've sent an ETag and gotten a 304 as the response. scontent-lengthc3s3|])\}}|jƒˆkr||fVqdS(N(R(t.0tktv(texcluded_headers(sT/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/cachecontrol/controller.pys ls iÈ( R R?R R@R R)R2tupdatetdicttitemsRBR\R](RRHR^R tcached_response((RfsT/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/cachecontrol/controller.pytupdate_cached_responseRs!    "N(R1t __module__t__doc__R R'Rt classmethodRR R;RSRVRbRk(((sT/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/cachecontrol/controller.pyR s 6 o [(RmtloggingtreRERDt email.utilsRtpip._vendor.requests.structuresRR Rt serializeRt getLoggerR1R-tcompileRRtobjectR (((sT/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/cachecontrol/controller.pyts