AlkantarClanX12
Current Path : /proc/self/root/lib/python2.7/site-packages/pip/_vendor/cachecontrol/ |
Current File : //proc/self/root/lib/python2.7/site-packages/pip/_vendor/cachecontrol/heuristics.pyc |
� ��abc @ 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 � Z d � Z d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d S( i����N( t formatdatet parsedatet parsedate_tz( t datetimet timedeltas %a, %d %b %Y %H:%M:%S GMTc C s | p t j � } | | S( N( R t now( t deltat date( ( sG /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/heuristics.pyt expire_after s c C s t t j | j � � � S( N( R t calendart timegmt timetuple( t dt( ( sG /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/heuristics.pyt datetime_to_header s t BaseHeuristicc B s# e Z d � Z d � Z d � Z RS( c C s d S( s! 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. s 110 - "Response is Stale"( ( t selft response( ( sG /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/heuristics.pyt warning s c C s i S( s� 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 ( ( sG /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/heuristics.pyt update_headers! s c C sa | j | � } | r] | j j | � | j | � } | d k r] | j j i | d 6� q] n | S( Nt Warning( R t headerst updateR t None( R R t updated_headerst warning_header_value( ( sG /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/heuristics.pyt apply* s ( t __name__t __module__R R R ( ( ( sG /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/heuristics.pyR s t OneDayCachec B s e Z d Z d � Z RS( sM Cache the response by providing an expires 1 day in the future. c C sn i } d | j k rj t | j d � } t t d d � d t | d � �} t | � | d <d | d <n | S( Nt expiresR t daysi i t publics cache-control( R R R R R R ( R R R R R ( ( sG /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/heuristics.pyR ; s ( R R t __doc__R ( ( ( sG /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/heuristics.pyR 6 s t ExpiresAfterc B s) e Z d Z d � Z d � Z d � Z RS( s; Cache **all** requests for a defined time period. c K s t | � | _ d S( N( R R ( R t kw( ( sG /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/heuristics.pyt __init__L s c C s'