Current File : //lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.pyc |
�
r2Wc @ sf 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 sP e Z e d d g � Z d e d d d d � Z d � Z e d � Z d � Z
RS( t PUTt DELETEc O sb t t | � j | | � | p% t � | _ | | _ | p= t } | | j d | d | �| _ d S( Nt cache_etagst
serializer( t superR t __init__R t cachet heuristicR t
controller( t selfR R t controller_classR R t argst kwt controller_factory( ( sD /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.pyR
s c K s{ | j d k r\ | j j | � } | r= | 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 GETt
from_cache( t methodR
t cached_requestt build_responset Truet headerst updatet conditional_headersR R t send( R t requestR t cached_responset resp( ( sD /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.pyR s c C sM | r� | j d k r� | j d k rr | j j | | � } | | k rO t } n | j d t � | j � | } q� | j d k r� | j j | | � q� | j r� | j j
| � } n t | j t
j | j j | | � � | _ 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
R i0 t decode_contenti- ( R t statusR
t update_cached_responseR t readt Falset release_connt cache_responseR t applyR t _fpt functoolst partialR R R t invalidating_methodst okt cache_urlt urlR t deleteR ( R R t responseR R R R- ( ( sD /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.pyR 2 s4
c C s$ | j j � t t | � j � d S( N( R t closeR R ( R ( ( sD /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.pyR1 s s
N( t __name__t
__module__t setR+ t NoneR R
R R$ R R1 ( ( ( sD /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.pyR
s
A(
R) t pip._vendor.requests.adaptersR R
R R R t filewrapperR R ( ( ( sD /usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.pyt <module> s