관리-도구
편집 파일: heuristics.cpython-35.pyc
��Re� � @ s� d d l Z d d l Z d d l m Z m Z m Z d d l m Z m Z d Z d d d � Z d d � Z Gd d � d e � Z Gd d � d e � Z Gd d � d e � Z Gd d � d e � Z d S)� N)� formatdate� parsedate�parsedate_tz)�datetime� timedeltaz%a, %d %b %Y %H:%M:%S GMTc C s | p t j � } | | S)N)r �utcnow)�delta�date� r ��/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 s r c C s t t j | j � � � S)N)r �calendar�timegm� timetuple)�dtr r r �datetime_to_header s r c @ s4 e Z d Z d d � Z d d � Z d d � Z d S)� BaseHeuristicc C s d S)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 sZ | j | � } | rV | j j | � | j | � } | d k rV | j 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"