ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     
abc           @   s   d  Z  d d l Z d d l Z d d l Z d d l Z d d l m Z d d l m Z d d l	 m
 Z
 d d l m Z e j e  Z e j d  Z d	   Z d
 e f d     YZ d S(   s7   
The httplib2 algorithms ported for use with requests.
iN(   t   parsedate_tz(   t   CaseInsensitiveDicti   (   t	   DictCache(   t
   Serializers9   ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?c         C   s<   t  j |   j   } | d | d | d | d | d f S(   s   Parses a URI using the regex given in Appendix B of RFC 3986.

        (scheme, authority, path, query, fragment) = parse_uri(uri)
    i   i   i   i   i   (   t   URIt   matcht   groups(   t   uriR   (    (    sG   /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/controller.pyt	   parse_uri   s    t   CacheControllerc           B   sn   e  Z d  Z d	 e d	 d  Z e d    Z e d    Z d   Z	 d   Z
 d   Z d	 d  Z d   Z RS(
   s9   An interface to see if request should cached or not.
    c         C   s1   | p t    |  _ | |  _ | p' t   |  _ d  S(   N(   R   t   cachet   cache_etagsR   t
   serializer(   t   selfR
   R   R   (    (    sG   /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/controller.pyt   __init__!   s    	c   	      C   s   t  |  \ } } } } } | s) | r< t d |   n  | j   } | j   } | sc d } n  | r~ d j | | g  p | } | d | | } | S(   s4   Normalize the URL to create a safe key for the caches(   Only absolute URIs are allowed. uri = %st   /t   ?s   ://(   R   t	   Exceptiont   lowert   join(	   t   clsR   t   schemet	   authorityt   patht   queryt   fragmentt   request_urit
   defrag_uri(    (    sG   /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/controller.pyt   _urlnorm&   s    	!c         C   s   |  j  |  S(   N(   R   (   R   R   (    (    sG   /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/controller.pyt	   cache_url:   s    c   
      C   s   i  } d } d | k r! d } n  | | k r | | j  d  } g  | D]R } d | j d  k rG t g  | j  d d  D] } | j   j   ^ qx  ^ qG } g  | D]3 } d | j d  k r | j   j   d f ^ q }	 t | |	  } n  | S(   sz   
        Parse the cache control headers returning a dictionary with values
        for the different directives.
        s   cache-controls   Cache-Controlt   ,it   =i   (   t   splitt   findt   tuplet   stripR   t   dict(
   R   t   headerst   retvalt	   cc_headert   partst   partt   xt   parts_with_argst   namet   parts_wo_args(    (    sG   /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/controller.pyt   parse_cache_control>   s    	\=c         C   s^  |  j  | j  } t j d |  |  j | j  } d | k rQ t j d  t Sd | k r~ | d d k r~ t j d  t S|  j j |  } | d k r t j d  t S|  j
 j | |  } | s t j d  t S| j d	 k r d
 } t j |  | St | j  } | s!d | k r^d | k rMt j d  |  j j |  n  t j d  t St j   } t j t | d   }	 t d | |	  }
 t j d |
  |  j |  } d } d | k r| d j   rt | d  } t j d |  n` d | k rZt | d  } | d k	 rZt j |  |	 } t d |  } t j d |  qZn  d | k ry$ t | d  } t j d |  Wqt k
 rd } qXn  d | k ry t | d  } Wn t k
 rd } n X|
 | 7}
 t j d |
  n  | |
 k r.t j d  t j d | |
  | Sd | k rZt j d  |  j j |  n  t S(   se   
        Return a cached response if it exists in the cache, otherwise
        return False.
        s   Looking up "%s" in the caches   no-caches-   Request header has "no-cache", cache bypasseds   max-agei    s1   Request header has "max_age" as 0, cache bypasseds   No cache entry availables1   Cache entry deserialization failed, entry ignoredi-  sV   Returning cached "301 Moved Permanently" response (ignoring date and etag information)t   datet   etags(   Purging cached response: no date or etags!   Ignoring cached response: no dates   Current age based on date: %is#   Freshness lifetime from max-age: %it   expiress#   Freshness lifetime from expires: %is+   Freshness lifetime from request max-age: %is	   min-freshs'   Adjusted current age from min-fresh: %is2   The response is "fresh", returning cached responses   %i > %is4   The cached response is "stale" with no etag, purgingN(   R   t   urlt   loggert   debugR.   R%   t   FalseR
   t   gett   NoneR   t   loadst   warningt   statusR   t   deletet   timet   calendart   timegmR    t   maxt   isdigitt   intt
   ValueError(   R   t   requestR   t   cct
   cache_datat   respt   msgR%   t   nowR/   t   current_aget   resp_cct   freshness_lifetimeR1   t   expire_timet	   min_fresh(    (    sG   /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/controller.pyt   cached_requestV   s    
	
		

	
c         C   s   |  j  | j  } |  j j | |  j j |   } i  } | r t | j  } d | k rk | d | d <n  d | k r | d | d <q n  | S(   NR0   t   ETags   If-None-Matchs   last-modifieds   Last-Modifieds   If-Modified-Since(   R   R2   R   R8   R
   R6   R   R%   (   R   RC   R   RF   t   new_headersR%   (    (    sG   /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/controller.pyt   conditional_headers   s    !c   
      C   s  d d d d g } | j  | k r; t j d | j  |  d St | j  } | d k	 r d | k r | d j   r t | d  t |  k r d S|  j	 | j  } |  j	 |  } |  j
 | j  } t j d |  t }	 | j d	  r t }	 t j d
  n  | j d	  r%t }	 t j d  n  |	 r]|  j j |  r]t j d  |  j j |  n  |  j rd | k rt j d  |  j j | |  j j | | d |  n| j  d k rt j d  |  j j | |  j j | |   n d | k r| rm| j d  rm| d j   rt | d  d k rt j d  |  j j | |  j j | | d |  qqd | k r| d rt j d  |  j j | |  j j | | d |  qqn  d S(   sc   
        Algorithm for caching requests.

        This assumes a requests Response object.
        i   i   i,  i-  s   Status code %s not in %sNs   content-lengths&   Updating cache with response from "%s"s   no-stores   Response header has "no-store"s   Request header has "no-store"s0   Purging existing cache entry to honor "no-store"R0   s   Caching due to etagt   bodys   Caching permanant redirectR/   s   max-agei    s'   Caching b/c date exists and max-age > 0R1   s   Caching b/c of expires header(   R:   R3   R4   R   R%   R7   R@   RA   t   lenR.   R   R2   R5   R6   t   TrueR
   R;   R   t   setR   t   dumps(
   R   RC   t   responseRR   t   cacheable_status_codest   response_headerst   cc_reqRD   R   t   no_store(    (    sG   /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/controller.pyt   cache_response   sd    		&	"
	c            s   |  j  | j  } |  j j | |  j j |   } | s= | Sd g   | j j t   f d   | j j	   D   d | _
 |  j j | |  j j | |   | S(   s   On a 304 we will get a new set of headers that we want to
        update our cached value with, assuming we have one.

        This should only ever be called when we've sent an ETag and
        gotten a 304 as the response.
        s   content-lengthc         3   s3   |  ]) \ } } | j      k r | | f Vq d  S(   N(   R   (   t   .0t   kt   v(   t   excluded_headers(    sG   /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/controller.pys	   <genexpr>T  s    	i   (   R   R2   R   R8   R
   R6   R%   t   updateR$   t   itemsR:   RU   RV   (   R   RC   RW   R   t   cached_response(    (   R`   sG   /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/controller.pyt   update_cached_response6  s    	
		&		N(   t   __name__t
   __module__t   __doc__R7   RT   R   t   classmethodR   R   R.   RN   RQ   R\   Rd   (    (    (    sG   /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/controller.pyR	      s   		y	W(   Rg   t   loggingt   reR=   R<   t   email.utilsR    t   pip._vendor.requests.structuresR   R
   R   t	   serializeR   t	   getLoggerRe   R3   t   compileR   R   t   objectR	   (    (    (    sG   /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/controller.pyt   <module>   s   		