Files
intellecton/venv/lib/python3.12/site-packages/cachecontrol/__pycache__/controller.cpython-312.pyc
T

122 lines
16 KiB
Plaintext
Raw Normal View History

Ë
jVJãó dZddlmZddlZddlZddlZddlZddlZddlm Z ddl
m Z m Z m
Z
ddlmZddlmZmZddlmZe rdd l
mZdd
lmZdd lmZdd lmZej6e«Zej<d
«ZdZ ddZ!Gdd«Z"y)z7
The httplib2 algorithms ported for use with requests.
é)Ú annotationsN)Ú parsedate_tz)Ú
TYPE_CHECKINGÚ
CollectionÚMapping)ÚCaseInsensitiveDict)Ú DictCacheÚSeparateBodyBaseCache)Ú
Serializer)ÚLiteral)ÚPreparedRequest)Ú HTTPResponse)Ú BaseCachez9^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?)é-é4có€tj|«}|J|j«}|d|d|d|d|dfS)zƒParses a URI using the regex given in Appendix B of RFC 3986.
(scheme, authority, path, query, fragment) = parse_uri(uri)
ééééé)ÚURIÚmatchÚgroups)Úurirrs úZ/home/antigravity/intellecton/venv/lib/python3.12/site-packages/cachecontrol/controller.pyÚ parse_urir'sMô
I‰Ic‹N€EØ Ð ÐÐ Ø
\‰\^€FØ 1‰Iv˜ay ¡)¨V°A©Y¸¸q¹ Ð cóÌeZdZdZ d
ddZedd«Zedd«ZddZddZ ddZ
dd „Z d dd
Z d dd Z
dd Zy)ÚCacheControllerz4An interface to see if request should cached or not.Ncót|
t«n||_||_|xs
t«|_|xsd|_y)N)éÈéËi,rr)r ÚcacheÚ cache_etagsr Ú
serializerÚcacheable_status_codes)Úselfr$r%r&Ú status_codess rÚ__init__zCacheController.__init__5s7ð%* M”Y”[°uˆŒ
Ø&ˆÔØ
« ˆŒØ&2Ò&OÐ6OˆÕ#rcóàt|«\}}}}}|r|std|z«|j«}|j«}|sd}|xrdj||g«xs|}|dz|z|z}|S)z4Normalize the URL to create a safe key for the cachez(Only absolute URIs are allowed. uri = %sú?z://)rÚ ExceptionÚlowerÚjoin) ÚclsrÚschemeÚ authorityÚpathÚqueryÚfragmentÚ request_uriÚ
defrag_uris rÚ_urlnormzCacheController._urlnormAs„ô6?¸s³^јD %¨Ù™YÜÐÑ ˆØ—O‘OÓ%ˆ áØˆDðÒ§¡¨$°¨Ó 7Ò?¸4ˆ ؘe‘^ iÑ/°+Ñ
àÐrcó$|j|«S)N)r9)r1rs rÚ cache_urlzCacheController.cache_urlUsà|‰|˜ Ð rc
ó†tdftdftdfddddddddtdfdœ }|jd|jdd««}i}|jd«D]j}|j«sŒ|jd d
«}|d j«} ||\}} |r| sd||<|sŒN ||d
j««||<Œl|S#t$rt
j
d |«YŒwxYw#t$r| rt
j
d
|«YŒ·t$r$t
j
d||j«YŒâwxYw)NTF)NF) úmax-agez max-staleú min-freshúno-cacheúno-storez no-transformzonly-if-cachedzmust-revalidateÚpublicÚprivatezproxy-revalidatezs-maxagez
cache-controlz
Cache-ControlÚú=rrz,Ignoring unknown cache-control directive: %sz-Missing value for cache-control directive: %sz8Invalid value for cache-control directive %s, must be %s)
ÚintÚgetÚsplitÚstripÚKeyErrorÚloggerÚdebugÚ
IndexErrorÚ
ValueErrorÚ__name__)
r(ÚheadersÚknown_directivesÚ
cc_headersÚretvalÚ cc_directiveÚpartsÚ directiveÚtypÚrequireds
rÚparse_cache_controlz#CacheController.parse_cache_controlYsfô˜T˜u˜Ü˜t˜Ø$Ø -ܘd˜ ñ
Ðð —[[ °'·+±+¸oÈrÓ2RÓSˆ
à(*ˆà&×,¨SÓ ˆ×à ×& s¨AÓ.ˆ˜a™ŸÓ(ˆIð
Ø 0°Ñ ;

™hØ$(ð
Ù(+¨E°!©H¯N©NÓ,<Ó(=F˜%ð# ð>ˆ
øô-ò
Ü ÐKÈYÔð
ûôÙÜŸ ØùôÜ—L‘LØŸ öðús*ÂC Â,C1Ã C.Ã-C.Ã1!EÄ)EÄ?Ecó‚d|jvry|j}|J|jj|«}|tj d«yt
|jt«r|jj|«}nd}|jj|||«}|tjd«|S)zO
Load a cached response, or return None if it's not available.
ÚRangeNzNo cache entry availablez1Cache entry deserialization failed, entry ignored) rPÚurlr$rGrKrLÚ
isinstancer
Úget_bodyr&ÚloadsÚwarning)r(Úrequestr;Ú
cache_dataÚ body_fileÚresults rÚ_load_from_cachez CacheController._load_from_cacheð g—o‘oÑ à—K‘Kˆ ØÐ—Z‘Z—^‘^ IÓ.ˆ
Ø Ð Ü L‰LÐ ä d—jjÔ"7Ô Ÿ
×+¨IÓ6‰Iàˆ×& 
¸FˆØ ˆ>Ü N‰NÐ ˆ
rcóð|jJ|j|j«}tjd|«|j |j
«}d|vrtjd«yd|vr|ddk(rtjd«y|j
|«}|syt|j«tvrd }tj|«|St|j
«}|rd
|vrJd |vr0tjd «|jj|«tjd
«ytj«}t|d
«}|Jtj |dd«} t#d|| z
«}
tjd|
«|j |«} d} | j%d«}
|
|
} tjd| «nQd|vrMt|d«}|=tj |dd«| z
}t#d|«} tjd| «|j%d«}
|
|
} tjd| «|j%d«}||
|z
}
tjd|
«| |
kDr.tjd«tjd| |
«|Sd |vr0tjd«|jj|«y)ze
Return a cached response if it exists in the cache, otherwise
return False.
NzLooking up "%s" in the cacher?z-Request header has "no-cache", cache bypassedFr=rz1Request header has "max_age" as 0, cache bypassedzQReturning cached permanent redirect response (ignoring date and etag information)ÚdateÚetagz(Purging cached response: no date or etagz!Ignoring cached response: no daterzCurrent age based on date: %iz#Freshness lifetime from max-age: %iÚexpiresz#Freshness lifetime from expires: %iz+Freshness lifetime from request max-age: %ir>z'Adjusted current age from min-fresh: %iz2The response is "fresh", returning cached responsez%i > %iz4The cached response is "stale" with no etag, purging)r\r;rKrLrYrPrerFÚstatusÚPERMANENT_REDIRECT_STATUSESrr$ÚdeleteÚtimerÚcalendarÚtimegmÚmaxrG)r(rar;ÚccÚrespÚmsgrPÚnowÚ
time_tuplergÚ current_ageÚresp_ccÚfreshness_lifetimeÚmax_ageriÚ expire_timeÚ min_freshs rÚcached_requestzCacheController.cached_request©ð
{‰{ЗNN 7§;¡;Ó/ˆ Ü Ð3°YÔ
×
% g§o¡oÓ
ð ˜Ñ Ü L‰LÐ à ˜‰?˜r )™}°Ò L‰LÐ ð×$ WÓÙØô ˆt{‰{Ó Ô 
ô
L‰L˜Ô ؈Kä,?ÀÇ Á Ó,MˆÙ˜&¨Ñ˜WÑ Ð
×!  L‰LÐ äi‰ikˆÜ! '¨&¡/Ó2ˆ
ØÐ˜z¨"¨1˜~Óܘ!˜S 4™ZÓ Ü Ð4°kÔ ×*¨7ÓðÐð—+‘+˜iÓØ Ð Ø!(Ð Ü L‰LÐ>Ð@RÕ ˜
" 7¨9Ñ#5Ó6ˆÐ&Ÿo™o¨g°b°q¨kÓ:¸A Ü%(¨¨KÓ%8Ð ÐBÐDVÔ—&&˜Ó#ˆØ Ð Ø!(Ð Ü L‰LØ=Ð?Qô
ð—F‘F˜;Ó'ˆ Ø Ð à ˜9Ñ $ˆKÜ L‰LÐBÀKÔ    Ò L‰LÐ L‰L˜Ð$6¸ Ô ˆKð ˜Ñ Ü L‰LÐ J‰J× Ñ ˜iÔ rcóŠ|j|«}i}|r-t|j«}d|vr|d|d<d|vr|d|d<|S)NrhÚETagz
If-None-Matchz
last-modifiedz
Last-ModifiedzIf-Modified-Since)rerrP)r(rarrÚ new_headersrPs rÚconditional_headersz#CacheController.conditional_headerss\Ø×$ WÓØˆ á Ü0CÀDÇLÁLÓ0QˆGà˜Ñ Ø/6°v© ˜ )Ø3:¸?Ñ3K ÐÐrcó\t|jt«rY|jj||jj ||d«|¬«||jj
||«yy|jj||jj |||«|¬«y)z.
Store the data in the cache.
r)riN)r]r$r
Úsetr&ÚdumpsÚset_body)r(r;raÚresponseÚbodyÚ expires_times rÚ
_cache_setzCacheController._cache_set&ô d—jjÔ"7Ô 
J‰JN‰NØØ×% g¨x¸Ó
ô
ðÐØ
×# I¨tÕ ð
J‰JN‰NØØ×% g¨x¸Ó
õ
rcót|tj«r