Re@sddlZddlZddlmZmZmZddlmZmZdZdddZ ddZ Gd d d e Z Gd d d e Z Gd dde ZGddde ZdS)N) formatdate parsedate parsedate_tz)datetime timedeltaz%a, %d %b %Y %H:%M:%S GMTcCs|ptj}||S)N)rutcnow)deltadater /builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/cachecontrol/heuristics.py expire_after sr cCsttj|jS)N)rcalendartimegm timetuple)dtr r r datetime_to_headersrc@s4eZdZddZddZddZdS) BaseHeuristiccCsdS)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"r )selfresponser r r warnings zBaseHeuristic.warningcCsiS)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. r )rrr r r update_headers!szBaseHeuristic.update_headerscCsZ|j|}|rV|jj||j|}|dk rV|jjd|i|S)NWarning)rheadersupdater)rrZupdated_headersZwarning_header_valuer r r apply*s zBaseHeuristic.applyN)__name__ __module__ __qualname__rrrr r r r rs  rc@s"eZdZdZddZdS) OneDayCachezM Cache the response by providing an expires 1 day in the future. cCsqi}d|jkrmt|jd}ttdddt|dd}t||ds   "