File: //lib/python2.7/site-packages/requests_toolbelt/auth/guess.pyo
ӵ Yc @ so d Z d d l m Z d d l m Z d d l m Z m Z d e j f d YZ d e f d YZ
d
S( s- The module containing the code for GuessAuth.i( t auth( t cookiesi ( t _digest_auth_compatt http_proxy_digestt GuessAuthc B s; e Z d Z d Z d Z d Z d Z d Z RS( s7 Guesses the auth type by the WWW-Authentication header.c C s( | | _ | | _ d | _ d | _ d S( N( t usernamet passwordt NoneR t pos( t selfR R ( ( s@ /usr/lib/python2.7/site-packages/requests_toolbelt/auth/guess.pyt __init__ s c C s | j d k r( | j j j | j n | j | j j | j j } t | d sl t
j | _ n t
j
| j | j | j | j | j t j | j | j | _ | j | } | j j | | } | j j | | | _ | S( Nt _cookies( R R t requestt bodyt seekt contentt rawt release_connt copyt hasattrR t RequestsCookieJarR t extract_cookies_to_jart prepare_cookiesR t
HTTPBasicAuthR R t
connectiont sendt historyt append( R t rt kwargst prept _r( ( s@ /usr/lib/python2.7/site-packages/requests_toolbelt/auth/guess.pyt _handle_basic_auth_401 s
c C s t j | j | j | _ y | j j Wn t k
r? n Xt | j d rs | j j d k rs d | j _ n | j j
| | S( Nt
num_401_callsi ( t auth_compatt HTTPDigestAuthR R R t init_per_thread_statet AttributeErrorR R! R t
handle_401( R R R ( ( s@ /usr/lib/python2.7/site-packages/requests_toolbelt/auth/guess.pyt _handle_digest_auth_401' s
c K sW | j j d d j } d | k r7 | j | | Sd | k rS | j | | Sd S( s/ Resends a request with auth headers, if needed.s www-authenticatet t basict digestN( t headerst gett lowerR R' ( R R R t www_authenticate( ( s@ /usr/lib/python2.7/site-packages/requests_toolbelt/auth/guess.pyR&