3
V'íct ã @ s¤ d Z ddlZddlZddlZddlmZ ddlmZ ddlm Z ddl
mZmZm
Z
mZmZ ddlmZmZmZmZ dd lmZmZmZ dd
lmZmZ ddlmZ ddlmZm Z m!Z! dd
l"m#Z#m$Z$m%Z%m&Z& ddl'm(Z( ddl)m*Z* ddlm+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1 ddl2m3Z3 ddlm4Z4 ej5dkrZy
ej6Z7W n e8k
rV ej9Z7Y nX nejZ7efddZ:efddZ;G dd de<Z=G dd de=Z>dd Z?dS )z
requests.sessions
~~~~~~~~~~~~~~~~~
This module provides a Session object to manage and persist settings across
requests (cookies, auth, proxies).
é N)Ú timedelta)ÚOrderedDicté )Ú_basic_auth_str)Ú cookielibÚis_py3ÚurljoinÚurlparseÚMapping)Úcookiejar_from_dictÚextract_cookies_to_jarÚRequestsCookieJarÚ
merge_cookies)ÚRequestÚPreparedRequestÚDEFAULT_REDIRECT_LIMIT)Ú
default_hooksÚ
dispatch_hook)Úto_native_string)Úto_key_val_listÚdefault_headersÚ
DEFAULT_PORTS)ÚTooManyRedirectsÚ
InvalidSchemaÚChunkedEncodingErrorÚContentDecodingError)ÚCaseInsensitiveDict)ÚHTTPAdapter)Úrequote_uriÚget_environ_proxiesÚget_netrc_authÚshould_bypass_proxiesÚget_auth_from_urlÚrewind_bodyÚresolve_proxies)Úcodes)ÚREDIRECT_STATIÚwin32c C st |dkr| S | dkr|S t |to*t | ts0| S |t|}|jt| dd |j D }x|D ]
}||= qbW |S )zèDetermines appropriate setting for a given request, taking into account
the explicit setting on that request, and the setting in the session. If a
setting is a dictionary, they will be merged together using `dict_class`
Nc S s g | ]\}}|d kr|qS )N© )Ú.0ÚkÚvr( r( ú5/tmp/pip-build-gk9425m9/requests/requests/sessions.pyú
<listcomp>J s z!merge_setting.<locals>.<listcomp>)Ú
isinstancer