Spade

Mini Shell

Directory:~$ /lib/python2.7/site-packages/future/backports/urllib/
Upload File

[Home] [System Details] [Kill Me]
Current File:~$ //lib/python2.7/site-packages/future/backports/urllib/request.pyc

�
,�]c@`sdZddlmZmZmZmZddlmZmZm	Z	m
Z
mZmZm
Z
mZddlmZmZmZddlZddlZddlZddlZddlmZddlmZdd	lmZmZmZdd
l
m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1ddl2m3Z3m4Z4ddl5Z5ddl6Z6ddl7Z7ddl8Z8ddl9Z9ddl:Z:ddl;Z;ddl<Z<ddl=Z=ddl>Z>ddlmZerdd
l?m@Z@ndd
lAm@Z@y
ddlBZBddlBmCZCWneDk
rZeEZFnXeGZFdddddddddddddddddd
d!d"d#d$d%d&d'd(d)d*d+d,d-gZHe:jId.
ZJeKaLeKe9jMd/�ZNd0�ZOgZPeKeKeKd1�ZQd2�ZRer1e8jSd3e8jT�ZUne8jSd3�ZUd4�ZVd5eWfd6��YZXd7eWfd8��YZYd9�ZZd:eWfd;��YZ[d<e[fd=��YZ\d>e[fd?��YZ]d@e[fdA��YZ^dB�Z_dCe[fdD��YZ`dEeWfdF��YZadGeafdH��YZbdIeWfdJ��YZcdKece[fdL��YZddMece[fdN��YZee6jfZgdOeWfdP��YZhdQe[ehfdR��YZidSe[ehfdT��YZjdUe[fdV��YZkdWekfdX��YZlemedY�rdZekfd[��YZneHjod\�nd]e[fd^��YZpd_e[fd`��YZqda�Zrdb�Zsdce[fdd��YZtde�Zudfe[fdg��YZvdhevfdi��YZwdjZxe6jydkkr�ddllzm{Z{m|Z|ndm�Z{dn�Z|iZ}doeWfdp��YZ~dqe~fdr��YZeKa�ds�Z�eKa�dt�Z�eKa�du�Z�eKa�dv�Z�dweWfdx��YZ�dy�Z�dz�Z�d{�Z�e:j�d|kr�dd}l�m�Z�m�Z�d~�Z�d�Z�d��Z�d��Z�nBe6jydkkrd��Z�d��Z�d��Z�d��Z�ne�Z�e�Z�dS(�u�

Ported using Python-Future from the Python 3.3 standard library.

An extensible library for opening URLs using a variety of protocols

The simplest way to use this module is to call the urlopen function,
which accepts a string containing a URL or a Request object (described
below).  It opens the URL and returns the results as file-like
object; the returned object has some extra methods described below.

The OpenerDirector manages a collection of Handler objects that do
all the actual work.  Each Handler implements a particular protocol or
option.  The OpenerDirector is a composite object that invokes the
Handlers needed to open the requested URL.  For example, the
HTTPHandler performs HTTP GET and POST requests and deals with
non-error returns.  The HTTPRedirectHandler automatically deals with
HTTP 301, 302, 303 and 307 redirect errors, and the HTTPDigestAuthHandler
deals with digest authentication.

urlopen(url, data=None) -- Basic usage is the same as original
urllib.  pass the url and optionally data to post to an HTTP URL, and
get a file-like object back.  One difference is that you can also pass
a Request instance instead of URL.  Raises a URLError (subclass of
IOError); for HTTP errors, raises an HTTPError, which can also be
treated as a valid response.

build_opener -- Function that creates a new OpenerDirector instance.
Will install the default handlers.  Accepts one or more Handlers as
arguments, either instances or Handler classes that it will
instantiate.  If one of the argument is a subclass of the default
handler, the argument will be installed instead of the default.

install_opener -- Installs a new opener as the default opener.

objects of interest:

OpenerDirector -- Sets up the User Agent as the Python-urllib client and
manages
the Handler classes, while dealing with requests and responses.

Request -- An object that encapsulates the state of a request.  The
state can be as simple as the URL.  It can also include extra HTTP
headers, e.g. a User-Agent.

BaseHandler --

internals:
BaseHandler and parent
_call_chain conventions

Example usage:

import urllib.request

# set up authentication info
authinfo = urllib.request.HTTPBasicAuthHandler()
authinfo.add_password(realm='PDQ Application',
                      uri='https://mahler:8092/site-updates.py',
                      user='klem',
                      passwd='geheim$parole')

proxy_support = urllib.request.ProxyHandler({"http" :
"http://ahad-haam:3128"})

# build a new opener that adds authentication and caching FTP handlers
opener = urllib.request.build_opener(proxy_support, authinfo,
                                     urllib.request.CacheFTPHandler)

# install it
urllib.request.install_opener(opener)

f = urllib.request.urlopen('http://www.python.org/')
i(tabsolute_importtdivisiontprint_functiontunicode_literals(tbytestdicttfiltertinputtinttmaptopentstr(tPY2tPY3traise_with_tracebackN(temail(tclienti(tURLErrort	HTTPErrortContentTooShortError(turlparseturlsplitturljointunwraptquotetunquotet	splittypet	splithostt	splitportt	splitusertsplitpasswdt	splitattrt
splitqueryt
splitvaluetsplittagtto_bytest
urlunparse(t
addinfourltaddclosehook(R(tIterable(t
SSLContextuRequestuOpenerDirectoruBaseHandleruHTTPDefaultErrorHandleruHTTPRedirectHandleruHTTPCookieProcessoruProxyHandleruHTTPPasswordMgruHTTPPasswordMgrWithDefaultRealmuAbstractBasicAuthHandleruHTTPBasicAuthHandleruProxyBasicAuthHandleruAbstractDigestAuthHandleruHTTPDigestAuthHandleruProxyDigestAuthHandleruHTTPHandleruFileHandleru
FTPHandleruCacheFTPHandleruUnknownHandleruHTTPErrorProcessoruurlopenuinstall_openerubuild_openerupathname2urluurl2pathnameu
getproxiesuurlretrieveu
urlcleanupu	URLopeneruFancyURLopeneric
K`sKd|kr
|d}|d=nt}d|krF|d}|d=nd}d|krl|d}|d=nd}|s�|s�|rts�td��ntjtj�}|jtjO_tj	|_
|s�|r�|j||�n
|j�t
d|dt�}t|�}	n"tdkr2t�a}	nt}	|	j|||�S(Nu	cadefaultucapathucafileuSSL
support not availabletcontexttcheck_hostname(tFalsetNonet	_have_sslt
ValueErrortsslR(tPROTOCOL_SSLv23toptionstOP_NO_SSLv2t
CERT_REQUIREDtverify_modetload_verify_locationstset_default_verify_pathstHTTPSHandlertTruetbuild_openert_openerR
(
turltdatattimeoutt_3to2kwargst	cadefaulttcapathtcafileR)t
https_handlertopener((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyturlopen�s6






cC`s
|adS(N(R:(RC((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytinstall_opener�sc
C`s�t|�\}}tjt||���K}|j�}|dkrb|rbtjj|�|fS|rzt|d�}n(t	j
dt�}|j}t
j|�|��||f}	d
}
d}d}d}
d|kr�t|d	�}n|r||
|
|�nxctrj|j|
�}|s'Pn|t|�7}|j|�|
d
7}
|r||
|
|�qqWWdQXWdQX|dkr�||kr�td||f|	��n|	S(uW
    Retrieve a URL into a temporary location on disk.

    Requires a URL argument. If a filename is passed, it is used as
    the temporary file location. The reporthook argument should be
    a callable that accepts a block number, a read size, and the
    total file size of the URL target. The data argument should be
    valid URL encoded data.

    If a filename is passed and the URL points to a local resource,
    the result is a copy from local file to new file.

    Returns a tuple containing the path to the newly created
    data file as well as the resulting HTTPMessage object.
   
ufileuwbtdeleteiii����iucontent-lengthuContent-LengthiNu1retrieval
incomplete: got only %i out of %i bytesi (Rt
contextlibtclosingRDtinfotostpathtnormpathR
ttempfiletNamedTemporaryFileR+tnamet_url_tempfilestappendRR8treadtlentwriteR(R;tfilenamet
reporthookR<turl_typeRKtfptheadersttfptresulttbstsizeRRtblocknumtblock((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyturlretrieve�sD	
	

#cC`sMx3tD]+}ytj|�Wqtk
r1qXqWt2trIdandS(N(RPRJtunlinktEnvironmentErrorR:R,(t	temp_file((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyt
urlcleanup�s

u:\d+$cC`sY|j}t|�d}|dkr:|jdd�}ntjd|d�}|j�S(u�Return
request-host, as defined by RFC 2965.

    Variation from RFC: returned value is lowercased, for convenient
    comparison.

    iuuHost(tfull_urlRt
get_headert_cut_port_retsubtlower(trequestR;thost((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytrequest_hosts	tRequestcB`s�eZdidedd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zd�Zd�Zd
�Zd�Zd�Zd�Zdd�Zd�ZRS(c	C`s�t|�|_t|j�\|_|_||_i|_d|_x*|j�D]\}}|j	||�qRWi|_
|dkr�t|�}n||_||_
||_|j�dS(N(RReR"tfragmentR<RYR,t_tunnel_hosttitemst
add_headertunredirected_hdrsRltorigin_req_hosttunverifiabletmethodt_parse(	tselfR;R<RYRsRtRutkeytvalue((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyt__init__s							cC`swt|j�\|_}|jdkr=td|j��nt|�\|_|_|jrst|j�|_ndS(Nuunknown
url type:
%r(	RRettypeR,R.RRktselectorR(Rwtrest((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRv.s	cC`s1|jdk	r|jS|jdk	r)dSdSdS(u3Return
a string indicating the HTTP request
method.uPOSTuGETN(RuR,R<(Rw((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyt
get_method6s
cC`s(|jrd|j|jfS|jSdS(Nu%s#%s(RnRe(Rw((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytget_full_url?s	cC`s)d}tj|tdd�||_dS(Nu&Request.add_data
method is deprecated.t
stackleveli(twarningstwarntDeprecationWarningR<(RwR<tmsg((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytadd_dataGscC`s)d}tj|tdd�|jdk	S(Nu&Request.has_data
method is
deprecated.R�i(R�R�R�R<R,(RwR�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pythas_dataLscC`s#d}tj|tdd�|jS(Nu&Request.get_data
method is
deprecated.R�i(R�R�R�R<(RwR�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytget_dataQscC`s#d}tj|tdd�|jS(Nu&Request.get_type
method is
deprecated.R�i(R�R�R�R{(RwR�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytget_typeVscC`s#d}tj|tdd�|jS(Nu&Request.get_host
method is
deprecated.R�i(R�R�R�Rk(RwR�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytget_host[scC`s#d}tj|tdd�|jS(Nu*Request.get_selector
method is
deprecated.R�i(R�R�R�R|(RwR�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytget_selector`scC`s#d}tj|tdd�|jS(Nu-Request.is_unverifiable
method is
deprecated.R�i(R�R�R�Rt(RwR�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytis_unverifiableescC`s#d}tj|tdd�|jS(Nu1Request.get_origin_req_host
method is
deprecated.R�i(R�R�R�Rs(RwR�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytget_origin_req_hostjscC`sJ|jdkr(|jr(|j|_n||_|j|_||_dS(Nuhttps(R{RoRkReR|(RwRkR{((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyt	set_proxyqs
	cC`s|j|jkS(N(R|Re(Rw((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyt	has_proxyyscC`s||j|j�<dS(N(RYt
capitalize(RwRxtval((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRq|scC`s||j|j�<dS(N(RrR�(RwRxR�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytadd_unredirected_header�scC`s||jkp||jkS(N(RYRr(Rwtheader_name((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyt
has_header�scC`s"|jj||jj||��S(N(RYtgetRr(RwR�tdefault((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRf�s	cC`s/|jj�}|j|j�t|j��S(N(RrtcopytupdateRYtlistRp(Rwthdrs((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytheader_items�sN(t__name__t
__module__R,R+RzRvR~RR�R�R�R�R�R�R�R�R�R�RqR�R�RfR�(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRms*																	tOpenerDirectorcB`sSeZd�Zd�Zd�Zd�Zdejd�Z	dd�Z
d�ZRS(cC`sMdt}d|fg|_g|_i|_i|_i|_i|_dS(NuPython-urllib/%su
User-agent(t__version__t
addheadersthandlersthandle_openthandle_errortprocess_responsetprocess_request(Rwtclient_version((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRz�s
				cC`s�t|d�s(tdt|���nt}xet|�D]W}|dkrSq;n|jd�}||
}||d}|jd�r�|jd�|d}||d}yt|�}Wntk
r�nX|j	j
|i�}	|	|j	|<n]|d	kr|}|j}	n?|d
kr3|}|j}	n!|dkr;|}|j
}	nq;|	j|g�}
|
rtj|
|�n
|
j|�t}q;W|r�tj|j|�|j|�ndS(
Nu
add_parentu%expected BaseHandler instance, got
%ruredirect_requestudo_openu
proxy_openu_iuerroruopenuresponseurequest(uredirect_requestudo_openu
proxy_open(thasattrt	TypeErrorR{R+tdirtfindt
startswithRR.R�R�R�R�R�t
setdefaulttbisecttinsortRQR8R�t
add_parent(Rwthandlertaddedtmethtitprotocolt	conditiontjtkindtlookupR�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytadd_handler�sJ



cC`sdS(N((Rw((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytclose�sc	G`sR|j|d�}x9|D]1}t||�}||�}|dk	r|SqWdS(N((R�tgetattrR,(	RwtchainR�t	meth_nametargsR�R�tfuncR[((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyt_call_chain�s
c
C`st|t�r|j�}nt|t�r?t||�}n|}|dk	r]||_n||_|j}|d}x8|j	j
|g�D]!}t||�}||�}q�W|j||�}	|d}x;|j
j
|g�D]$}t||�}|||	�}	q�W|	S(u�
        Accept a URL or a Request object

        Python-Future: if the URL is passed as a byte-string, decode it
first.
        u_requestu	_responseN(t
isinstanceRtdecodeRRmR,R<R=R{R�R�R�t_openR�(
RwtfullurlR<R=treqR�R�t	processorR�tresponse((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR
�s&		

cC`sp|j|jdd|�}|r%|S|j}|j|j||d|�}|rW|S|j|jdd|�S(Nudefaultudefault_openu_openuunknownuunknown_open(R�R�R{(RwR�R<R[R�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR��s	
cG`s�|d
kr<|jd}|d}d|}d}|}n|j}|d}d}|||f|}|j|�}|r�|S|r�|dd	f|}|j|�SdS(Nuhttpuhttpsiu
http_error_%siu_erroriudefaultuhttp_error_default(uhttpuhttps(R�R�(RwtprotoR�RR�thttp_errt	orig_argsR[((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyterror
s



		
N(R�R�RzR�R�R�R,tsockett_GLOBAL_DEFAULT_TIMEOUTR
R�R�(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR��s		/		"cG`s@d�}t�}ttttttttg}t	t
d�rO|jt�nt
�}xl|D]d}x[|D]S}||�r�t||�r�|j|�q�qlt||�rl|j|�qlqlWq_Wx|D]}|j|�q�Wx|D]}|j|��q�Wx3|D]+}||�r+|�}n|j|�q
W|S(u*Create
an opener object from a list of handlers.

    The opener will use several default handlers, including support
    for HTTP, FTP and when applicable HTTPS.

    If any of the handlers passed as arguments are subclasses of the
    default handlers, the default handlers will not be used.
   
cS`st|t�pt|d�S(Nu	__bases__(R�R{R�(tobj((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytisclass/suHTTPSConnection(R�tProxyHandlertUnknownHandlertHTTPHandlertHTTPDefaultErrorHandlertHTTPRedirectHandlert
FTPHandlertFileHandlertHTTPErrorProcessorR�thttp_clientRQR7tsett
issubclasstaddR�tremoveR�(R�R�RCtdefault_classestskiptklasstcheckth((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR9&s0					




tBaseHandlercB`s)eZdZd�Zd�Zd�ZRS(i�cC`s
||_dS(N(tparent(RwR�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�OscC`sdS(N((Rw((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�RscC`s#t|d�stS|j|jkS(Nu
handler_order(R�R8t
handler_order(Rwtother((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyt__lt__Vs(R�R�R�R�R�R�(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�Ls		R�cB`s#eZdZdZd�ZeZRS(uProcess
HTTP error
responses.i�cC`sd|j|j|j�}}}d|ko7dkns`|jjd|||||�}n|S(Ni�i,uhttp(tcodeR�RIR�R�(RwRjR�R�R�R�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyt
http_responsecs

	(R�R�t__doc__R�R�thttps_response(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�_s	R�cB`seZd�ZRS(cC`st|j||||��dS(N(RRe(RwR�RXR�R�R�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pythttp_error_defaultqs(R�R�R�(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�psR�cB`s:eZdZdZd�Zd�ZeZZZdZ	RS(ii
c	`s�|j�}|dkr$|dkp9|dko9|dksZt|j||||��n|jdd	�}d�t�fd�|jj�D��}t|d
|d|jdt	�S(u�Return
a Request or None in response to a redirect.

        This is called by the http_error_30x methods when a
        redirection response is received.  If a redirection should
        take place, return a new Request to allow http_error_30x to
        perform the redirect.  Otherwise, raise HTTPError if no-one
        else should try to handle this url.  Return None if you can't
        but another Handler might.
        i-i.i/i3uGETuHEADuPOSTu
u%20ucontent-lengthucontent-typec3`s3|])\}}|j��kr||fVqdS(N(Ri(t.0tktv(tCONTENT_HEADERS(sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pys	<genexpr>�s	RYRsRt(i-i.i/i3(uGETuHEAD(i-i.i/(ucontent-lengthucontent-type(
R~RRetreplaceRRYRpRmRsR8(	RwR�RXR�R�RYtnewurltmt
newheaders((R�sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytredirect_request|s
%		c
C`s�d|kr|d}nd|kr2|d}ndSt|�}|jdkrvt||d||f||��n|js�t|�}d|d	<nt|�}t|j|�}|j||||||�}|dkr�dSt
|d
�r[|j}	|_|	j|d�|j
ks3t|	�|jkrot|j||j|||��qoni}	|_|_|	j|d�d|	|<|j�|j�|jj|d
|j�S(Nulocationuuriuhttpuhttpsuftpuu+%s
- Redirection to url '%s' is not
allowedu/iu
redirect_dictiiR=(uhttpuhttpsuftpu(RtschemeRRKR�R$RReR�R,R�t
redirect_dictR�tmax_repeatsRStmax_redirectionstinf_msgRRR�R�R
R=(
RwR�RXR�R�RYR�turlpartstnewtvisited((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pythttp_error_302�s<


	


uoThe HTTP server returned a redirect error that would lead to an infinite
loop.
The last 30x error message was:
(
R�R�R�R�R�R�thttp_error_301thttp_error_303thttp_error_307R�(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�ts	"	7c	C`s�t|�\}}|jd�s0d}|}nV|jd�sRtd|��n|jdd�}|dkryd}n|d|!}t|�\}}|dk	r�t|�\}}n
d}}||||fS(u3Return (scheme, user, password, host/port) given a
URL or an authority.

    If a URL is supplied, it must have an authority (host:port) component.
    According to RFC 3986, having an authority component means the URL must
    have two slashes after the scheme:

    >>> _parse_proxy('file:/ftp.example.com/')
    Traceback (most recent call last):
    ValueError: proxy URL with no authority:
'file:/ftp.example.com/'

    The first three items of the returned tuple may be None.

    Examples of authority parsing:

    >>> _parse_proxy('proxy.example.com')
    (None, None, None, 'proxy.example.com')
    >>> _parse_proxy('proxy.example.com:3128')
    (None, None, None, 'proxy.example.com:3128')

    The authority component may optionally include userinfo (assumed to be
    username:password):

    >>> _parse_proxy('joe:password@proxy.example.com')
    (None, 'joe', 'password',
'proxy.example.com')
    >>>
_parse_proxy('joe:password@proxy.example.com:3128')
    (None, 'joe', 'password',
'proxy.example.com:3128')

    Same examples, but with URLs instead:

    >>> _parse_proxy('http://proxy.example.com/')
    ('http', None, None, 'proxy.example.com')
    >>> _parse_proxy('http://proxy.example.com:3128/')
    ('http', None, None, 'proxy.example.com:3128')
    >>>
_parse_proxy('http://joe:password@proxy.example.com/')
    ('http', 'joe', 'password',
'proxy.example.com')
    >>>
_parse_proxy('http://joe:password@proxy.example.com:3128')
    ('http', 'joe', 'password',
'proxy.example.com:3128')

    Everything after the authority is ignored:

    >>>
_parse_proxy('ftp://joe:password@proxy.example.com/rubbish:3128')
    ('ftp', 'joe', 'password',
'proxy.example.com')

    Test for no trailing '/' case:

    >>>
_parse_proxy('http://joe:password@proxy.example.com')
    ('http', 'joe', 'password',
'proxy.example.com')

    u/u//uproxy URL with no authority:
%rii����N(RR�R,R.R�RR(	tproxyR�tr_schemet	authoritytendtuserinfothostporttusertpassword((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyt_parse_proxy�s2		

R�cB`s#eZdZdd�Zd�ZRS(idcC`s�|dkrt�}nt|d�s3td��||_x=|j�D]/\}}t|d||||jd��qIWdS(Nukeysuproxies
must be a
mappingu%s_opencS`s||||�S(N((trRR{R�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyt<lambda>/s(R,t
getproxiesR�tAssertionErrortproxiesRptsetattrt
proxy_open(RwR
R{R;((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRz(s	
cC`s|j}t|�\}}}}|dkr6|}n|jrRt|j�rRdS|r�|r�dt|�t|�f}	tj|	j��j	d�}
|j
dd|
�nt|�}|j||�||ks�|dkr�dS|jj
|d|j�SdS(Nu%s:%suasciiuProxy-authorizationuBasic
uhttpsR=(R{RR,Rktproxy_bypassRtbase64t	b64encodetencodeR�RqR�R�R
R=(RwR�RR{t	orig_typet
proxy_typeRRRt	user_passtcreds((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR2s
		N(R�R�R�R,RzR(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�$s
tHTTPPasswordMgrcB`s8eZd�Zd�Zd�Zed�Zd�ZRS(cC`s
i|_dS(N(tpasswd(Rw((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRzPscC`s�t|t�r|g}n||jkr:i|j|<nxVttfD]H}tg|D]}|j||�^qW�}||f|j||<qGWdS(N(R�RRR8R+ttuplet
reduce_uri(RwtrealmturiRRtdefault_porttutreduced_uri((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytadd_passwordSs(c	C`s�|jj|i�}xjttfD]\}|j||�}xA|j�D]3\}}x$|D]}|j||�rZ|SqZWqGWq"WdS(N(NN(RR�R8R+RRpt	is_suburiR,(	RwRtauthuritdomainsRtreduced_authurituristauthinfoR((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytfind_user_password^s
c
C`s�t|�}|dr=|d}|d}|dp7d}nd
}|}d}t|�\}}|r�|d
kr�|d
k	r�idd6dd6j|�}	|	d
k	r�d	||	f}q�n||fS(u@Accept authority or URI and extract only
the authority and path.iiiu/iPuhttpi�uhttpsu%s:%dN(RR,RR�(
RwRRtpartsR�RRKRktporttdport((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRhs





	cC`si||krtS|d|dkr(tStj|d|df�}t|�t|d�kretStS(ucCheck
if test is below base in a URI tree

        Both args must be URIs in reduced form.
       
ii(R8R+t	posixpathtcommonprefixRS(Rwtbasettesttcommon((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR"s(R�R�RzR!R(R8RR"(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRNs
			
tHTTPPasswordMgrWithDefaultRealmcB`seZd�ZRS(cC`sDtj|||�\}}|dk	r1||fStj|d|�S(N(RR(R,(RwRR#RR((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR(�s

(R�R�R((((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR1�stAbstractBasicAuthHandlercB`sDeZejdej�Zdd�Zd�Zd�Z	d�Z
RS(u1(?:.*,)*[ 	]*([^ 	]+)[
	]+realm=(["']?)([^"']*)\2cC`s=|dkrt�}n||_|jj|_d|_dS(Ni(R,RRR!tretried(Rwtpassword_mgr((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRz�s
	cC`s
d|_dS(Ni(R3(Rw((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytreset_retry_count�sc
C`s1|j|d�}|jdkrBt|j�dd|d��n|jd7_|r-|j�d}|j�dkr�td|��q-tj	j
|�}|r-|j�\}}}|dkr�tj
d
td�n|j�dkr*|j|||�}	|	r#|	jdkr#d|_n|	Sq-ndS(
Nii�ubasic
auth failediiubasicuDAbstractBasicAuthHandler does not support the
following scheme: '%s'u"u'uBasic Auth Realm was
unquotedi(u"u'(R�R,R3RRtsplitRiR.R2trxtsearchtgroupsR�R�tUserWarningtretry_http_basic_authR�(
RwtauthreqRkR�RYR�tmoRRR�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pythttp_error_auth_reqed�s*
	
cC`s�|jj||�\}}|dk	r�d||f}dtj|j��jd�}|jj|j	d�|kr{dS|j
|j	|�|jj|d|j
�SdSdS(Nu%s:%suBasic
uasciiR=(RR(R,RRRR�RYR�tauth_headerR�R�R
R=(RwRkR�RRtpwtrawtauth((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR;�s"N(R�R�tretcompiletIR7R,RzR5R>R;(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR2�s			
tHTTPBasicAuthHandlercB`seZdZd�ZRS(u
AuthorizationcC`s/|j}|jd|||�}|j�|S(Nuwww-authenticate(ReR>R5(RwR�RXR�R�RYR;R�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pythttp_error_401�s
		
(R�R�R?RG(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRF�stProxyBasicAuthHandlercB`seZdZd�ZRS(uProxy-authorizationcC`s/|j}|jd|||�}|j�|S(Nuproxy-authenticate(RkR>R5(RwR�RXR�R�RYRR�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pythttp_error_407�s
		
(R�R�R?RI(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRH�stAbstractDigestAuthHandlercB`sSeZdd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
RS(	cC`sO|dkrt�}n||_|jj|_d|_d|_d|_dS(Ni(R,RRR!R3tnonce_countt
last_nonce(RwR((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRzs			cC`s
d|_dS(Ni(R3(Rw((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR5scC`s�|j|d�}|jdkr?t|jdd|d��n|jd7_|r�|j�d}|j�dkr�|j||�S|j�dkr�td|��q�ndS(	Nii�udigest
auth failediiudigestubasicuEAbstractDigestAuthHandler does not support
the following scheme:
'%s'(	R�R,R3RReR6Ritretry_http_digest_authR.(RwR?RkR�RYR<R�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR>scC`s�|jdd�\}}ttdt|���}|j||�}|r�d|}|jj|jd�|krwdS|j	|j|�|j
j|d|j�}|SdS(Nu iu	Digest
%sR=(
R6tparse_keqv_listRR,tparse_http_listtget_authorizationRYR�R?R�R�R
R=(RwR�RBttokent	challengetchaltauth_valtresp((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRM(s
cC`sRd|j|tj�f}|jd�td�}tj|�j�}|d
S(Nu	%s:%s:%s:uasciiii(RKttimetctimeRt_randombytesthashlibtsha1t	hexdigest(Rwtnoncetstbtdig((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyt
get_cnonce4scC`s[yK|d}|d}|jd�}|jdd�}|jdd�}Wntk
r_dSX|j|�\}}	|dkr�dS|jj||j�\}
}|
dkr�dS|jdk	r�|j|j|�}nd}d|
||f}
d|j	�|j
f}|d	kr�||jkr9|jd
7_nd
|_||_d|j}|j
|�}d||||||�f}|	||
�|�}nD|dkr�|	||
�d|||�f�}ntd
|��d|
|||j
|f}|r|d|7}n|r,|d|7}n|d|7}|rW|d||f7}n|S(Nurealmunonceuqopu	algorithmuMD5uopaqueu%s:%s:%su%s:%suauthiu%08xu%s:%s:%s:%s:%suqop
'%s' is not supported.u>username="%s",
realm="%s", nonce="%s", uri="%s",
response="%s"u
, opaque="%s"u
,
digest="%s"u, algorithm="%s"u, qop=auth, nc=%s,
cnonce="%s"(R�R,tKeyErrortget_algorithm_implsRR(ReR<tget_entity_digestR~R|RLRKR`R(RwR�RSRR\tqopt	algorithmtopaquetHtKDRR@tentdigtA1tA2tncvaluetcnoncetnoncebittrespdigR.((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRP?sV



		
(
c`sI|dkrd��n|dkr0d��n�fd�}�|fS(NuMD5cS`stj|jd��j�S(Nuascii(RYtmd5RR[(tx((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR
~suSHAcS`stj|jd��j�S(Nuascii(RYRZRR[(Rq((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR
�sc`s�d||f�S(Nu%s:%s((R]td(Rg(sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR
�s((RwReRh((RgsC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRb{scC`sdS(N(R,(RwR<RS((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRc�sN(R�R�R,RzR5R>RMR`RPRbRc(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRJ�s						<	
tHTTPDigestAuthHandlercB`s#eZdZdZdZd�ZRS(u�An
authentication protocol defined by RFC 2069

    Digest authentication improves on basic authentication because it
    does not transmit passwords in the clear.
   
u
Authorizationi�cC`s9t|j�d}|jd|||�}|j�|S(Niuwww-authenticate(RReR>R5(RwR�RXR�R�RYRktretry((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRG�s
	
(R�R�R�R?R�RG(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRs�stProxyDigestAuthHandlercB`seZdZdZd�ZRS(uProxy-Authorizationi�cC`s/|j}|jd|||�}|j�|S(Nuproxy-authenticate(RkR>R5(RwR�RXR�R�RYRkRt((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRI�s
		
(R�R�R?R�RI(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRu�stAbstractHTTPHandlercB`s/eZdd�Zd�Zd�Zd�ZRS(icC`s
||_dS(N(t_debuglevel(Rwt
debuglevel((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRz�scC`s
||_dS(N(Rw(Rwtlevel((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytset_http_debuglevel�sc
C`s�|j}|std��n|jdk	r>|j}t|t�rZd}t|��n|jd�s||jdd�n|jd�s>d}yQt	r�t|t
j
�r�t|�|j}nt
|�}t|�|j}Wn?tk
r#t|t�r8tdt|�|f��q8q;X|jdd|�q>n|}|j�rzt|j�\}}	t|	�\}}
n|jd�s�|jd|�nxH|jjD]:\}}|j�}|j|�s�|j||�q�q�W|S(	Nu
no
host givenuLPOST data should be bytes or an iterable of bytes. It cannot be
of type
str.uContent-typeu!application/x-www-form-urlencodeduContent-lengthuBContent-Length
should be specified for iterable data of type %r
%ru%duHost(RkRR<R,R�RR�R�R�RtarrayRStitemsizet
memoryviewR'R.R{R�RR|RR�R�R�(
RwRjRkR<R�R]tmvtsel_hostR�tseltsel_pathRORy((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytdo_request_�sJ		

	c
`s�|j}|std��n||d|j|�}t|j���jt�fd�|jj�D���d�d<td��j�D���|jr�i}d}|�kr��|||<�|=n|j	|jd|�ny&|j
|j�|j|j
��Wn,tjk
r=}|j�t|��n/X|j�}	|jrl|jj�d	|_n|j�|	_|	j|	_|	S(
u�Return an HTTPResponse object for the request, using http_class.

        http_class must implement the HTTPConnection API from http.client.
        u
no host
givenR=c3`s-|]#\}}|�kr||fVqdS(N((R�R�R�(RY(sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pys	<genexpr>�s	ucloseu
Connectioncs`s'|]\}}|j�|fVqdS(N(ttitle(R�ROR�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pys	<genexpr>�suProxy-AuthorizationRYN(RkRR=RRrR�RYRpRot
set_tunnelRjR~R|R<R�R�R�tgetresponsetsockR,RR;treasonR�(
Rwt
http_classR�thttp_conn_argsRkR�ttunnel_headerstproxy_auth_hdrterrR	((RYsC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytdo_open�s6	,
	
&
	
(R�R�RzRzR�R�(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRv�s		3R�cB`seZd�ZejZRS(cC`s|jtj|�S(N(R�R�tHTTPConnection(RwR�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyt	http_open$s(R�R�R�RvR�thttp_request(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�"s	uHTTPSConnectionR7cB`s,eZdddd�Zd�ZejZRS(icC`s&tj||�||_||_dS(N(RvRzt_contextt_check_hostname(RwRxR)R*((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRz-s	cC`s%|jtj|d|jd|j�S(NR)R*(R�R�tHTTPSConnectionR�R�(RwR�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyt
https_open2sN(R�R�R,RzR�RvR�t
https_request(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR7+s	uHTTPSHandlertHTTPCookieProcessorcB`s2eZdd�Zd�Zd�ZeZeZRS(cC`s=ddljjj}|dkr0|j�}n||_dS(Ni(tfuture.backports.http.cookiejart	backportsthttpt	cookiejarR,t	CookieJar(RwR�thttp_cookiejar((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRz;scC`s|jj|�|S(N(R�tadd_cookie_header(RwRj((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�AscC`s|jj||�|S(N(R�textract_cookies(RwRjR�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�EsN(R�R�R,RzR�R�R�R�(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�:s
		R�cB`seZd�ZRS(cC`s|j}td|��dS(Nuunknown
url type:
%s(R{R(RwR�R{((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytunknown_openMs	(R�R�R�(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�LscC`smi}x`|D]X}|jdd�\}}|ddkr[|ddkr[|dd!}n|||<q
W|S(u>Parse
list of key=value strings where keys are not
duplicated.u=iiu"i����(R6(tltparsedteltR�R�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRNQs

cC`s�g}d}t}}x�|D]�}|r?||7}t}qn|r�|dkr]t}qn|dkrrt}n||7}qn|dkr�|j|�d}qn|dkr�t}n||7}qW|r�|j|�ng|D]}|j�^q�S(upParse
lists as described by RFC 2068 Section 2.

    In particular, parse comma-separated lists where the elements of
    the list may include quoted-strings.  A quoted-string could
    contain a comma.  A non-quoted string could have quotes in the
    middle.  Neither commas nor quotes count if they are escaped.
    Only double-quotes count, not single-quotes.
   
uu\u"u,(R+R8RQtstrip(R]trestparttescapeRtcur((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRO[s4	


	

	R�cB`s)eZd�ZdZd�Zd�ZRS(cC`s||j}|d
dkrk|dd!dkrk|jrk|jdkrk|j|j�k	rxtd��qxn
|j|�SdS(Niu//iu/u	localhostu-file://
scheme is supported only on
localhost(R|Rkt	get_namesRtopen_local_file(RwR�R;((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyt	file_open�s	,cC`s|tjdkruy7ttjd�dtjtj��d�t_Wqutjk
rqtjd�ft_quXntjS(Nu	localhosti(	R�tnamesR,RR�tgethostbyname_extgethostnametgaierrort
gethostbyname(Rw((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR��s$cC`sUddljjj}ddl}|j}|j}t|�}y�tj	|�}|j
}|j|jdt
�}	|j|�d}
tjd|
p�d||	f�}|r�t|�\}}n|s�|r"t|�|j�kr"|r�d||}
n
d|}
tt|d�||
�SWntk
rD}t|��nXtd��dS(Nitusegmtu6Content-type: %s
Content-length: %d
Last-modified: %s
u
text/plainufile://urbufile not on local
host(tfuture.backports.email.utilsR�Rtutilst	mimetypesRkR|turl2pathnameRJtstattst_sizet
formatdatetst_mtimeR8t
guess_typetmessage_from_stringRt_safe_gethostbynameR�R%R
tOSErrorR(RwR�temail_utilsR�RkRUt	localfiletstatsR]tmodifiedtmtypeRYR*torigurltexp((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR��s0			
N(R�R�R�R,R�R�R�(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR��s	
	cC`s-ytj|�SWntjk
r(dSXdS(N(R�R�R�R,(Rk((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR��sR�cB`seZd�Zd�ZRS(cC`s�ddl}ddl}|j}|s6td��nt|�\}}|dkr`|j}nt|�}t|�\}}|r�t	|�\}}nd}t
|�}|p�d}|p�d}ytj|�}Wn"tj
k
r�}t|��nXt|j�\}	}
|	jd�}ttt
|��}|d
|d}}|rg|drg|d}ny|j||||||j�}
|r�dp�d}xM|
D]E}t|�\}}|j�d	kr�|dkr�|j�}q�q�W|
j||�\}}d}|j|j�d}|r8|d|7}n|dk	ra|dkra|d|7}ntj|�}t|||j�SWn0|jk
r�}td|�}t|�nXdS(Niuftp error: no host
givenuu/i����iuIuDutypeuauAuiuduContent-type: %s
uContent-length: %d
u
ftp error: %r(uauAuiuIuduD(
tftplibR�RkRRR,tFTP_PORTRRRRR�R�R�RR|R6R�R	tconnect_ftpR=R!RituppertretrfileR�ReRR�R%t
all_errorsR(RwR�R�R�RkR*RRR�RKtattrstdirstfiletfwR{tattrRyRXtretrlenRYR�R�texc((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytftp_open�s\	
!
c	C`st||||||dt�S(Nt
persistent(t
ftpwrapperR+(RwRRRkR*R�R=((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR��s(R�R�R�R�(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR��s	5tCacheFTPHandlercB`s>eZd�Zd�Zd�Zd�Zd�Zd�ZRS(cC`s1i|_i|_d|_d|_d|_dS(Nii<i(tcacheR=tsoonesttdelayt	max_conns(Rw((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRz�s
				cC`s
||_dS(N(R�(Rwtt((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyt
setTimeoutscC`s
||_dS(N(R�(RwR�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytsetMaxConnsscC`s�|||dj|�|f}||jkrJtj�|j|j|<n<t||||||�|j|<tj�|j|j|<|j�|j|S(Nu/(tjoinR�RVR�R=R�tcheck_cache(RwRRRkR*R�R=Rx((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�
s
cC`s
tj�}|j|krxxZt|jj��D]@\}}||kr1|j|j�|j|=|j|=q1q1Wntt|jj���|_t	|j�|j
krxJt|jj��D]3\}}||jkr�|j|=|j|=Pq�q�Wtt|jj���|_ndS(N(RVR�R�R=RpR�R�tmintvaluesRSR�(RwR�R�R�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�s"
"

cC`sBx!|jj�D]}|j�qW|jj�|jj�dS(N(R�R�R�tclearR=(Rwtconn((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytclear_cache)s
(R�R�RzR�R�R�R�R�(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR��s					i
unt(R�tpathname2urlcC`s
t|�S(uOS-specific conversion from a relative URL of the
'file' scheme
        to a file system path; not recommended for general
use.(R(tpathname((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�8scC`s
t|�S(uOS-specific conversion from a file system path to a relative URL
        of the 'file' scheme; not recommended for general
use.(R(R�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�=st	URLopenercB`s�eZdZdZdeZdd�Zd�Zd�Z	d�Z
d�Zdd�Zdd�Z
dd	�Zdddd
�Zd�Zdd�Zdd
�Zd�Zer�d�Zdd�Znd�Zd�Zd�Zdd�ZRS(u,Class
to open URLs.
    This is a class rather than just a subroutine because we may need
    more than one set of global protocol-specific options.
    Note -- this is a base class for those who don't want the
    automatic handling of errors type 302 (relocated) and 401
    (authorization
needed).uPython-urllib/%scK`s�di|jjd6}tj|tdd�|dkrEt�}nt|d�s`td��||_	|j
d�|_|j
d�|_d	|j
fg|_g|_tj|_d|_t|_dS(
NuW%(class)s style of invoking requests is deprecated. Use newer urlopen
functions/methodsuclassR�iukeysuproxies must be a
mappingukey_fileu	cert_fileu
User-Agent(t	__class__R�R�R�R�R,RR�RR
R�tkey_filet	cert_filetversionR�t_URLopener__tempfilesRJRat_URLopener__unlinkt	tempcachetftpcache(RwR
tx509R�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRzWs			cC`s|j�dS(N(R�(Rw((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyt__del__qscC`s|j�dS(N(tcleanup(Rw((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�tscC`si|jrLx6|jD]+}y|j|�Wqtk
r=qXqW|j2n|jre|jj�ndS(N(R�R�R�R�R�(RwR�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�ws	

	cG`s|jj|�dS(udAdd a header to be used by the HTTP interface
only
        e.g. u.addheader('Accept',
'sound/basic')N(R�RQ(RwR�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyt	addheader�scC`s�tt|��}t|dd�}|jrn||jkrn|j|\}}t|d�}t|||�St|�\}}|s�d}n||jkr�|j|}t|�\}}	t|	�\}
}|
|f}nd	}d|}||_
|jdd�}t||�sD|r1|j
|||�S|j||�Sny9|d	krft||�|�St||�||�SWn<tk
r��n)tjk
r�}
ttd|
��nXd	S(
u6Use URLopener().open(file) instead of open(file,
'r').tsafeu%/:=&?~#+!$,;'@()*[]|urbufileuopen_u-u_usocket
errorN(RR#RR�R
R%RR
RR,R{R�R�topen_unknown_proxytopen_unknownR�RR�R�RtIOError(RwR�R<RURYRXturltypeR;Rt	proxyhostRkR|ROR�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR
�s<	

	
cC`s(t|�\}}tdd|��dS(u/Overridable
interface to open unknown URL type.u	url erroruunknown url
typeN(RR�(RwR�R<R{R;((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR��scC`s,t|�\}}tdd||��dS(u/Overridable
interface to open unknown URL type.u	url erroruinvalid proxy for
%sN(RR�(RwRR�R<R{R;((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR��sc
C`s�tt|��}|jr5||jkr5|j|St|�\}}|dkr�|sf|dkr�yC|j|�}|j�}|j�tt	|�d�|fSWq�t
k
r�}	q�Xn|j||�}z�|j�}
|r�t|d�}n�ddl}t|�\}
}t	|p%d�\}
}t
|p=d�\}}
t|pUd�\}}
tjj|�d}|j|�\}}|jj|�tj|d�}z�||
f}|jdk	r�||j|<nd
}d	}d}d}d
|
krt|
d�}n|r,||||�nx\|j|�}|sHPn|t|�7}|j|�|d7}|r/||||�q/q/Wd|j�XWd|j�X|dkr�||kr�td||f|��n|S(utretrieve(url)
returns (filename, headers) for a local object
        or (tempfilename, headers) for a remote
object.ufileiuwbiNuiii����ucontent-lengthuContent-Lengthu1retrieval
incomplete: got only %i out of %i bytesi
(RR#R�RR,R�RIR�R�RR�R
RMR
RRJRKtsplitexttmkstempR�RQtfdopenRRRRSRTR(RwR;RURVR<R{turl1RXR�R�RYRZRMtgarbageRKtsuffixtfdR[R\R]RRR^R_((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytretrieve�sl


cC`s�d}d}t|t�r]t|�\}}|rTt|�\}}t|�}n|}n�|\}}t|�\}}t|�\}	}
|
}d}|	j�dkr�d}n^t|
�\}}
|r�t|�\}}n|r�d|	||
f}nt|�r|}n|s*t	dd��n|r]t|�}t
j|j��j
d�}nd}|r�t|�}t
j|j��j
d�}nd}||�}
i}|r�d||d<n|r�d||d<n|r�||d	<nd
|d<x!|jD]\}}|||<qW|dk	rLd|d
<|
jd|||�n|
jd|d|�y|
j�}Wn
tjk
r�td��nXd|jko�dknr�t||jd||j�S|j||j|j|j|j|�SdS(u�Make
an HTTP connection using connection_class.

        This is an internal method that should be called from
        open_http() or open_https().

        Arguments:
        - connection_factory should take a host name and return an
          HTTPConnection instance.
        - url is the url to retrieval or a host, relative-path pair.
        - data is payload for a POST request or None.
        uhttpu	%s://%s%su
http erroru
no host givenuasciiuBasic
%suProxy-Authorizationu
AuthorizationuHostucloseu
Connectionu!application/x-www-form-urlencodeduContent-TypeuPOSTuGETRYu$http
protocol error: bad status
linei�i,uhttp:N(R,R�RRRRRRiRR�RRRR�R�RjR�R�t
BadStatusLineRtstatusR%R�t
http_errorRXR�(Rwtconnection_factoryR;R<tuser_passwdtproxy_passwdRkR|trealhostR�R}t
proxy_authRBt	http_connRYtheaderRyR�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyt_open_generic_http�sr
			!!



	cC`s|jtj||�S(uUse HTTP protocol.(R
R�R�(RwR;R<((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyt	open_httpXsc
C`s�d|}t||�rwt||�}|dkrO||||||�}	n|||||||�}	|	rw|	Sn|j|||||�S(u�Handle
http errors.

        Derived class can override this, or provide specific handlers
        named http_error_DDD where DDD is the 3-digit error
code.u
http_error_%dN(R�R�R,R�(
RwR;RXterrcodeterrmsgRYR<RORuR[((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR\s
cC`s&|j�t||||d��dS(u>Default
error handler: close the connection and raise
IOError.N(R�RR,(RwR;RXRR
RY((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�ls
cC`stj|d|jd|j�S(NR�R�(R�R�R�R�(RwRk((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyt_https_connectionrs	cC`s|j|j||�S(uUse
HTTPS protocol.(R
R(RwR;R<((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyt
open_httpswscC`szt|t�std��n|d
dkri|dd!dkri|dd!j�dkritd��n
|j|�Sd	S(
u/Use local file or FTP depending on form of URL.uEfile error: proxy
support for file protocol currently not implementediu//iu/iu
localhost/u-file:// scheme is supported only on
localhostN(R�RRRiR.R�(RwR;((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyt	open_file{s
<cC`s�ddljjj}ddl}t|�\}}t|�}ytj|�}Wn(t	k
r|}t
|j|j��nX|j
}	|j|jdt�}
|j|�d}tjd|p�d|	|
f�}|s|}
|d
dkr�d|}
ntt|d	�||
�St|�\}}|r�tj|�t�ft�kr�|}
|d
dkrsd|}
n#|d
 dkr�td|��ntt|d	�||
�St
d
��dS(uUse local file.iNR�u6Content-Type: %s
Content-Length: %d
Last-modified: %s
u
text/plainiu/ufile://urbiu./uAlocal file url may start with / or
file:. Unknown url of type: %su#local file error: not on local
host(R�R�RR�R�RR�RJR�R�RtstrerrorRUR�R�R�R8R�R�R%R
RR�R�t	localhosttthishostR.(RwR;R�R�RkR�t	localnameR�teR]R�R�RYturlfileR*((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR��s:	
"
c
C`sdt|t�std��nddl}t|�\}}|sQtd��nt|�\}}t|�\}}|r�t|�\}}nd}t	|�}t	|p�d�}t	|p�d�}t
j|�}|s�ddl}|j
}nt|�}t|�\}}	t	|�}|jd�}
|
d |
d}
}|
r_|
dr_|
d}
n|
r}|
dr}d|
d<n|||dj|
�f}t|j�tkr�xJ|jj�D]6}
|
|kr�|j|
}|j|
=|j�q�q�Wny9||jkr.t|||||
�|j|<n|s=d	}nd
}xM|	D]E}t|�\}}|j�dkrJ|dkrJ|j�}qJqJW|j|j||�\}}|jd|�d}d}|r�|d|7}n|dk	r|dkr|d|7}ntj|�}t||d|�SWn*t
�k
r_}t!td|��nXdS(uUse FTP protocol.uCftp error: proxy
support for ftp protocol currently not implementediNuftp error: no host
givenuu/i����iuDuIutypeuauAuiuduftp:uContent-Type: %s
uContent-Length: %d
uftp error
%r(uauAuiuIuduD("R�RRR�RRRRR,RR�R�R�R�RRR6R�RSR�tMAXFTPCACHEtkeysR�R�R!RiR�R�R�RR�R%t	ftperrorsR(RwR;R�RkRKR*RRR�R�R�R�RxR�R�R{R�RyRXR�R�RYR�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytopen_ftp�sp



"	
c	C`s�t|t�std��ny|jdd�\}}Wn
tk
r\tdd��nX|sld}n|jd�}|dkr�d	||kr�||d}||
}nd
}g}|jdtj	dtj
tj����|jd
|�|dkr+tj|j
d��jd�}nt|�}|jdt|��|jd
�|j|�dj|�}tj|�}tj|�}t|||�S(uUse
"data" URL.uEdata error: proxy support for data protocol
currently not implementedu,iu
data errorubad data URLutext/plain;charset=US-ASCIIu;iu=uuDate:
%su%a, %d %b %Y %H:%M:%S GMTuContent-type:
%subase64uasciiulatin-1uContent-Length: %du
(R�RRR6R.R�trfindRQRVtstrftimetgmtimeRtdecodebytesRR�RRSR�RR�tiotStringIOR%(	RwR;R<R{tsemitencodingR�RYtf((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyt	open_data�s6
	
$

N(R�R�R�R,R�R�R�RzR�R�R�R�R
R�R�R�R
RRR�R-RRRR�RR$(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�Js.
				$B	\					
	:tFancyURLopenercB`s�eZdZd�Zd�Zdd�Zd�Zdd�Zdd�Z	dd�Z
ded�Zded	�Z
dd
�Zdd�Zdd�Zdd
�Zdd�Zd�ZRS(u?Derived class
with handlers for errors we can handle
(perhaps).cO`s2tj|||�i|_d|_d|_dS(Nii
(R�Rzt
auth_cachettriestmaxtries(RwR�tkwargs((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRzs		cC`st||d||�S(u3Default
error handling -- don't raise an
exception.uhttp:(R%(RwR;RXRR
RY((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�sc	C`s�|jd7_|jrm|j|jkrmt|d�rE|j}n	|j}d|_|||dd|�S|j||||||�}d|_|S(u%Error
302 -- relocated (temporarily).iuhttp_error_500ii�u)Internal Server
Error: Redirect
Recursion(R'R(R�thttp_error_500R�tredirect_internal(	RwR;RXRR
RYR<R�R[((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�s		
		c	C`s�d|kr|d}nd|kr2|d}ndS|j�t|jd||�}t|�}|jd	kr�t|||d|||��n|j|�S(
Nulocationuuriu:uhttpuhttpsuftpuu( Redirection to url '%s'
is not allowed.(uhttpuhttpsuftpu(R�RR{RR�RR
(	RwR;RXRR
RYR<R�R�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR+%s


	cC`s|j||||||�S(u*Error 301 -- also relocated
(permanently).(R�(RwR;RXRR
RYR<((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�AscC`s|j||||||�S(u;Error
303 -- also relocated (essentially identical to
302).(R�(RwR;RXRR
RYR<((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�EscC`sE|dkr(|j||||||�S|j|||||�SdS(u1Error
307 -- relocated, but turn POST into
error.N(R,R�R�(RwR;RXRR
RYR<((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�Isc
C`s$d|kr+tj||||||�n|d}tjd|�}	|	sltj||||||�n|	j�\}
}|
j�dkr�tj||||||�n|s�tj||||||�nd|jd}|dkrt||�||�St||�|||�SdS(u_Error
401 -- authentication required.
        This function supports Basic authentication
only.uwww-authenticateu![ 	]*([^ 	]+)[
	]+realm="([^"]*)"ubasicuretry_u_basic_authN(	R�R�RCtmatchR9RiR{R,R�(
RwR;RXRR
RYR<RttstuffR,R�RRO((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRGPs&

c
C`s$d|kr+tj||||||�n|d}tjd|�}	|	sltj||||||�n|	j�\}
}|
j�dkr�tj||||||�n|s�tj||||||�nd|jd}|dkrt||�||�St||�|||�SdS(ueError
407 -- proxy authentication required.
        This function supports Basic authentication
only.uproxy-authenticateu![ 	]*([^ 	]+)[
	]+realm="([^"]*)"ubasicuretry_proxy_u_basic_authN(	R�R�RCR,R9RiR{R,R�(
RwR;RXRR
RYR<RtR-R,R�RRO((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRIis&

cC`st|�\}}d||}|jd}t|�\}}	t|	�\}	}
|	jd�d}|	|}	|j|	||�\}}
|p�|
s�dSdt|dd�t|
dd�|	f}	d|	|
|jd<|dkr�|j|�S|j||�SdS(Nuhttp://uhttpu@iu%s:%s@%sR�u(RR
RR�tget_user_passwdR,RR
(RwR;RR<RkR|R�RR�R�t
proxyselectorR�RR((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytretry_proxy_http_basic_auth�s



cC`st|�\}}d||}|jd}t|�\}}	t|	�\}	}
|	jd�d}|	|}	|j|	||�\}}
|p�|
s�dSdt|dd�t|
dd�|	f}	d|	|
|jd<|dkr�|j|�S|j||�SdS(Nuhttps://uhttpsu@iu%s:%s@%sR�u(RR
RR�R.R,RR
(RwR;RR<RkR|R�RR�R�R/R�RR((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytretry_proxy_https_basic_auth�s



c
C`s�t|�\}}|jd�d}||}|j|||�\}}|pS|sZdSdt|dd�t|dd�|f}d||}	|dkr�|j|	�S|j|	|�SdS(Nu@iu%s:%s@%sR�uuhttp://(RR�R.R,RR
(
RwR;RR<RkR|R�RRR�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR;�s

c
C`s�t|�\}}|jd�d}||}|j|||�\}}|pS|sZdSdt|dd�t|dd�|f}d||}	|dkr�|j|	�S|j|	|�SdS(Nu@iu%s:%s@%sR�uuhttps://(RR�R.R,RR
(
RwR;RR<RkR|R�RRR�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytretry_https_basic_auth�s

icC`s�|d|j�}||jkrD|r6|j|=qD|j|Sn|j||�\}}|sh|r~||f|j|<n||fS(Nu@(RiR&tprompt_user_passwd(RwRkRR�RxRR((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR.�s
cC`slddl}y@td||f�}|jd|||f�}||fSWntk
rgt�dSXdS(u#Override this in a GUI environment!iNuEnter username
for %s at %s: u#Enter password for %s in %s at %s:
(NN(tgetpassRtKeyboardInterrupttprintR,(RwRkRR4RR((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR3�s	
N(R�R�R�RzR�R,R�R+R�R�R�R+RGRIR0R1R;R2R.R3(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR%s$			cC`s"tdkrtjd�antS(u8Return
the IP address of the magic hostname 'localhost'.u	localhostN(t
_localhostR,R�R�(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�scC`sftdkrby#ttjtj��d�aWqbtjk
r^ttjd�d�aqbXntS(u,Return the IP addresses of the current
host.iu	localhostN(t	_thishostR,RR�R�R�R�(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�s#
cC`s(tdkr$ddl}|jantS(u1Return the set of errors raised by the
FTP class.iN(t
_ftperrorsR,R�R�(R�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�scC`s"tdkrtjd�antS(u%Return
an empty email Message object.uN(t
_noheadersR,RR�(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyt	noheaders�sR�cB`sSeZdZded�Zd�Zd�Zd�Zd�Z	d�Z
d�ZRS(	u;Class used by open_ftp() for cache of open FTP
connections.cC`sV||_||_||_||_||_||_d|_||_|j�dS(Ni(	RRRkR*R�R=trefcountt	keepalivetinit(RwRRRkR*R�R=R�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRz	s								cC`s�ddl}d|_|j�|_|jj|j|j|j�|jj|j	|j
�dj|j�}|jj
|�dS(Niu/(R�tbusytFTPtftptconnectRkR*R=tloginRRR�R�tcwd(RwR�t_target((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR>	s	cC`sddl}|j�|dkr1d}d}nd|}d}y|jj|�Wn.|jk
r�|j�|jj|�nXd}|r|ry&d|}|jj|�\}}Wq|jk
r}t	|�d d	krt
td
|��qqXn|s�|jjd�|r�|jj�}	zPy|jj
|�Wn5|jk
r�}td
|�}
||
_|
�nXWd|jj
|	�Xd|}nd}|jj|�\}}nd|_t|jd
�|j�}|jd7_|j�||fS(NiuduDuTYPE
AiuTYPE uRETR iu550u
ftp error: %ruLIST
uLISTurb(uduD(R�tendtransferRAtvoidcmdR�R>R,tntransfercmdt
error_permRRRtpwdRDt	__cause__R?R&tmakefilet
file_closeR<R�(RwR�R{R�tcmdtisdirR�R�R�RJR�tftpobj((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�	sP
	



	
	
cC`s
d|_dS(Ni(R?(Rw((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRFK	scC`s)t|_|jdkr%|j�ndS(Ni(R+R=R<t
real_close(Rw((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�N	s	cC`sC|j�|jd8_|jdkr?|jr?|j�ndS(Nii(RFR<R=RQ(Rw((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRMS	s
cC`s6|j�y|jj�Wnt�k
r1nXdS(N(RFRAR�R(Rw((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRQY	s

N(R�R�R�R,R8RzR>R�RFR�RMRQ(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�	s			0			cC`s]i}xPtjj�D]?\}}|j�}|r|ddkr|||d
<qqW|S(uReturn a dictionary of scheme -> proxy server URL
mappings.

    Scan the environment for variables named <scheme>_proxy;
    this seems to be the standard convention.  If you need a
    different way, you can pass a proxies dictionary to the
    [Fancy]URLopener constructor.

   
i����u_proxy(RJtenvironRpRi(R
RORy((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytgetproxies_environmenta	s	cC`s�tjjdd�p'tjjdd�}|dkr:dSt|�\}}g|jd�D]}|j�^q\}x6|D].}|r{|j|�s�|j|�r{dSq{WdS(u�Test
if proxies should not be used for a particular host.

    Checks the environment for a variable named no_proxy, which should
    be a list of DNS suffixes separated by commas, or '*' for all
hosts.
   
uno_proxyuuNO_PROXYu*iu,i(RJRRR�RR6R�tendswith(Rktno_proxythostonlyR*Rt
no_proxy_listRO((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytproxy_bypass_environmentq	s*(
$cC`s|ddlm}t|�\}}d�}d|krH|drHtSnd}x'|jdd
�D]}|ssqantjd|�}|dk	ra|dkr�ytj|�}||�}Wq�tj	k
r�qaq�Xn||j
d��}	|j
d	�}
|
dkr,d
|j
d�jd�d}
nt|
d�}
d|
}
||
?|	|
?krttSqa|||�ratSqaWt
S(uj
    Return True iff this host shouldn't be accessed using a proxy

    This function uses the MacOSX framework SystemConfiguration
    to fetch the proxy information.

    proxy_settings come from _scproxy._get_proxy_settings or get mocked ie:
    { 'exclude_simple': bool,
      'exceptions': ['foo.bar', '*.bar.com',
'127.0.0.1', '10.1', '10.0/16']
    }
   
i(tfnmatchcS`s|jd�}ttt|��}t|�dkrS|ddddgd
}n|dd>|dd>B|dd>B|d	BS(
Nu.iiiiiiii(R6R�R	RRS(tipAddrR)((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytip2num�	s
u.uexclude_simpleu
exceptionsu(\d+(?:\.\d+)*)(/\d+)?iiii
N((RYRR8R,R�RCR,R�R�R�tgrouptcountRR+(Rktproxy_settingsRYRVR*R[thostIPRyR�R.tmask((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyt_proxy_bypass_macosx_sysconf�	s:	

#
udarwin(t_get_proxy_settingst_get_proxiescC`st�}t||�S(N(RbRa(RkR^((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytproxy_bypass_macosx_sysconf�	s	cC`st�S(u�Return
a dictionary of scheme -> proxy server URL mappings.

        This function uses the MacOSX framework SystemConfiguration
        to fetch the proxy information.
       
(Rc(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytgetproxies_macosx_sysconf�	scC`s!t�rt|�St|�SdS(N(RSRXRd(Rk((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�	s	
cC`st�pt�S(N(RSRe(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR�	scC`sai}yddl}Wntk
r*|SXy|j|jd�}|j|d�d}|r5t|j|d�d�}d|kr�x�|jd�D]M}|jdd�\}}tjd	|�s�d
||f}n|||<q�Wq5|d
dkr||d
<q5d||d
<d||d<d||d<n|j	�Wnt
ttfk
r\nX|S(uxReturn a dictionary of scheme -> proxy server URL
mappings.

        Win32 uses the registry to store proxies.

        iNu;Software\Microsoft\Windows\CurrentVersion\Internet
SettingsuProxyEnableuProxyServeru=u;iu^([^/:]+)://u%s://%siuhttp:uhttpu	http://%su
https://%suhttpsuftp://%suftp(
twinregtImportErrortOpenKeytHKEY_CURRENT_USERtQueryValueExRR6RCR,tClosetWindowsErrorR.R�(R
RftinternetSettingstproxyEnabletproxyServertpR�taddress((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytgetproxies_registry�	s8
		

cC`st�pt�S(u�Return
a dictionary of scheme -> proxy server URL mappings.

        Returns settings gathered from the environment, if specified,
        or the registry.

       
(RSRr(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyR
scC`s�yddl}Wntk
r$dSXyK|j|jd�}|j|d�d}t|j|d�d�}Wntk
r�dSX|s�|r�dSt|�\}}|g}y/tj	|�}||kr�|j
|�nWntjk
r�nXy/tj|�}||kr&|j
|�nWntjk
r=nX|j
d�}x�|D]�}	|	dkryd|krydSn|	jdd	�}	|	jd
d�}	|	jdd�}	x*|D]"}
tj|	|
tj�r�dSq�WqTWdS(
Niu;Software\Microsoft\Windows\CurrentVersion\Internet
SettingsuProxyEnableu
ProxyOverrideu;u<local>u.iu\.u*u.*u?(RfRgRhRiRjRRlRR�R�RQR�tgetfqdnR6R�RCR,RE(RkRfRmRnt
proxyOverridetrawHostR*taddrtfqdnR/R�((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pytproxy_bypass_registry
sR
		

	

cC`s!t�rt|�St|�SdS(u�Return
a dictionary of scheme -> proxy server URL mappings.

        Returns settings gathered from the environment, if specified,
        or the registry.

       
N(RSRXRx(Rk((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyRH
s	
(�R�t
__future__RRRRtfuture.builtinsRRRRRR	R
Rtfuture.utilsRR
RRR�RYR{tfuture.backportsRtfuture.backports.httpRR�R�RRRtparseRRRRRRRRRRRRR
R!R"R#R$R�R%R&RRJR,RCR�tsysRVRMRGR�tcollectionsR'tcollections.abcR/R(RgR+R-R8t__all__R�R�R,R:R�RDRERPR`RdRDtASCIIRgRltobjectRmR�R9R�R�R�R�RR�RR1R2RFRHturandomRXRJRsRuRvR�R�R7RQR�R�RNROR�R�R�R�RROt
nturl2pathR�R�R�R�R%R7RR8RR9RR:R;R�RSRXRatplatformt_scproxyRbRcRdReRRRrRx(((sC/usr/lib/python2.7/site-packages/future/backports/urllib/request.pyt<module>Gs�":p

					
	?		y�	&h	H*@
E	�z
	
	+4	:8		���		
		
^			<		
		-			2