"JdddlZddlZddlmZmZmZddlmZmZdZddZ dZ Gdde Z Gd d e Z Gd d e ZGd de ZdS)N) formatdate parsedate parsedate_tz)datetime timedeltaz%a, %d %b %Y %H:%M:%S GMTc6|ptj}||zSN)rutcnow)deltadates V/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/cachecontrol/heuristics.py expire_afterr s  $8?$$D %<chttj|Sr )rcalendartimegm timetuple)dts r datetime_to_headerrs" hobllnn55 6 66rc eZdZdZdZdZdS) BaseHeuristiccdS)a! Return a valid 1xx warning header value describing the cache adjustments. The response is provided too allow warnings like 113 http://tools.ietf.org/html/rfc7234#section-5.5.4 where we need to explicitly say response is over 24 hours old. z110 - "Response is Stale"selfresponses r warningzBaseHeuristic.warnings +*rciS)zUpdate the response headers with any new headers. NOTE: This SHOULD always include some Warning header to signify that the response was cached by the client, not by way of the provided headers. rrs r update_headerszBaseHeuristic.update_headers!s  rc||}|rM|j|||}||jd|i|S)NWarning)rheadersupdater)rrupdated_headerswarning_header_values r applyzBaseHeuristic.apply*so--h77  K   # #O 4 4 4#'<<#9#9 #/ ''4H(IJJJrN)__name__ __module__ __qualname__rrr&rrr rrsA + + +     rrceZdZdZdZdS) OneDayCachezM Cache the response by providing an expires 1 day in the future. ci}d|jvr_t|jd}ttdt |dd}t ||d<d|d<|S) Nexpiresr )days)r public cache-control)r"rrrrr)rrr"r r-s r rzOneDayCache.update_headers<su H, , ,X-f566D"9!#4#4#48T"1"X;NOOOG!3G! ,-c*|j}d|vriSd|vr|ddkriS|j|jvriSd|vsd|vriStjt |d}t |d}||iStj}td||z }|tj|z }tdt|dz d}||kriS||z} dtj ttj | iS) Nr-r2r1r z last-modifiedr iQ) r"statuscacheable_by_default_statusesrrrrtimemaxminstrftimeTIME_FMTgmtime) rrespr"r last_modifiednow current_ager freshness_lifetimer-s r rzLastModified.update_headershs/,   I g % %'/*Bh*N*NI ;d@ @ @I  O7$B$BI|GFO<<==!'/":;; <=0Iikk!S4Z(( x}555 C I$>$>??  , ,I++4=4;w3G3GHHIIrcdSr r)rrSs r rzLastModified.warningstrN)r'r(r)r3rLrrrrr r=r=XsQ  %%%!JJJ<rr=r )rrM email.utilsrrrrrrQrrobjectrr+r5r=rrr r[s( ;;;;;;;;;;(((((((( & 777FD-"!!!!!=!!!"/////=/////r