B š•Reæ ã @ sŽ d dl Z d dlZd dlmZmZmZ d dlmZmZ dZddd„Z dd„ Z G d d „ d eƒZG dd„ deƒZ G d d„ deƒZG dd„ deƒZdS )é N)Ú formatdateÚ parsedateÚparsedate_tz)ÚdatetimeÚ timedeltaz%a, %d %b %Y %H:%M:%S GMTc C s |p t ¡ }|| S )N)r Úutcnow)ÚdeltaÚdate© r ú’/builddir/build/BUILDROOT/alt-python37-pip-20.2.4-6.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/pip/_vendor/cachecontrol/heuristics.pyÚexpire_after s r c C s t t | ¡ ¡ƒS )N)r ÚcalendarÚtimegmÚ timetuple)Údtr r r Údatetime_to_header s r c @ s$ e Zd Zdd„ Zdd„ Zdd„ ZdS )Ú BaseHeuristicc C s dS )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 )ÚselfÚresponser r r Úwarning s zBaseHeuristic.warningc C s i S )zïUpdate 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 )r r r r r Úupdate_headers! s zBaseHeuristic.update_headersc C s@ | |¡}|r<|j |¡ | |¡}|d k r<|j d|i¡ |S )NÚWarning)r ÚheadersÚupdater )r r Zupdated_headersZwarning_header_valuer r r Úapply* s zBaseHeuristic.applyN)Ú__name__Ú __module__Ú__qualname__r r r r r r r r s r c @ s e Zd ZdZdd„ ZdS )ÚOneDayCachezM Cache the response by providing an expires 1 day in the future. c C sR i }d|j krNt|j d ƒ}ttddt|d d… Ž d}t|ƒ|d<