Viewing File: /opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/cachecontrol/adapter.pyo
ó
“tÆ_c @ s~ 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
d e f d „ ƒ YZ d S( iÿÿÿÿN( t HTTPAdapteri ( t CacheController( t DictCache( t CallbackFileWrappert CacheControlAdapterc B sS e Z d d h Z d e d d d d d „ Z d d „ Z e d d „ Z d „ Z RS( t PUTt DELETEc
O s} t t | ƒ j | | Ž | d k r. t ƒ n | | _ | | _ | pI d | _ | pX t } | | j d | d | ƒ| _ d S( Nt GETt cache_etagst
serializer( R (
t superR t __init__t NoneR t cachet heuristict cacheable_methodsR t
controller(
t selfR
R t controller_classR R R t argst kwt controller_factory( ( sQ /opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/cachecontrol/adapter.pyR s c K s« | p | j } | j | k rŒ y | j j | ƒ } Wn t j k
rP d } n X| rm | j | | d t ƒS| j j
| j j | ƒ ƒ n t t
| ƒ j | | } | S( s”
Send a request. Use the request information to see if it
exists in the cache and cache the response if we need to and can.
t
from_cacheN( R t methodR t cached_requestt zlibt errorR t build_responset Truet headerst updatet conditional_headersR
R t send( R t requestR R t cacheablet cached_responset resp( ( sQ /opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/cachecontrol/adapter.pyR $ s
c
s• | p | j } | r*| j | k r*| j rC | j j | ƒ } n | j d k rŸ | j j | | ƒ } | | k r| t } n | j d t ƒ | j
ƒ | } q*| j d k rÄ | j j | | ƒ q*t | j
t j | j j | | ƒ ƒ | _
| j r*| j ‰ ‡ f d † } t j | | ƒ | _ q*n t t | ƒ j | | ƒ } | j | j k rˆ| j rˆ| j j | j ƒ } | j j | ƒ n | | _ | S( s¥
Build a response by making a request or using the cache.
This will end up calling send and returning a potentially
cached response
i0 t decode_contenti- c s* ˆ ƒ | j d k r&