%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python27/lib/python2.7/site-packages/future/backports/http/
Upload File :
Create Path :
Current File : //opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyo

�
�A�[c@`s�dZddlmZmZmZmZddlmZmZm	Z	m
Z
ddlmZddl
mZddl
mZddlmZddlZddlZddlZddlZdd	lmZddlZdd
lmZddd
dddddddddddddgZdZdZdZ dZ!dZ"d Z#d!Z$d"Z%d#Z&d$Z'd%Z(d&Z)d'Z*d(Z+d)Z,d*Z-d+Z.d,Z/d-Z0d.Z1d/Z2d0Z3d1Z4d2Z5d3Z6d4Z7d5Z8d6Z9d7Z:d8Z;d9Z<d:Z=d;Z>d<Z?d=Z@d>ZAd?ZBd@ZCdAZDdBZEdCZFdDZGdEZHdFZIdGZJdHZKdIZLdJZMdKZNdLZOdMZPdNZQdOZRdPZSdQZTdRZUdSZVdTZWdUZXi-dVd!6dWd"6dXd$6dYd%6dZd&6d[d'6d\d(6d]d)6d^d*6d_d-6d`d.6dad/6dbd06dcd16ddd26dedf6dgd36dhd46did56djd66dkd76dld86dmd96dnd:6dod;6dpd<6dqd=6drd>6dsd?6dtd@6dudA6dvdB6dwdC6dxdD6dydE6dzdJ6d{dK6d|dL6d}dM6d~dN6ddO6d�dP6d�dQ6d�dR6d�dU6ZYd�ZZd�Z[d!Z\d�ej]fd���YZ^e^d��Z_e`�Zad�ejbfd���YZcd�e`fd���YZdy ddleZedd�lemfZfWnegk
ran$Xd�edfd���YZhejid��d�ejfd���YZkd�ekfd���YZld�ekfd���YZmd�ekfd���YZnd�ekfd���YZod�ekfd���YZpd�ekfd���YZqd�ekfd���YZrd�erfd���YZsd�erfd���YZtd�erfd���YZud�ekfd���YZvd�ekfd���YZwekZxdS(�uD
HTTP/1.1 client library

A backport of the Python 3.3 http/client.py module for python-future.

<intro stuff goes here>
<other stuff, too>

HTTPConnection goes through a number of "states", which define when a client
may legally make another request or fetch the response for a particular
request. This diagram details these state transitions:

    (null)
      |
      | HTTPConnection()
      v
    Idle
      |
      | putrequest()
      v
    Request-started
      |
      | ( putheader() )*  endheaders()
      v
    Request-sent
      |
      | response = getresponse()
      v
    Unread-response   [Response-headers-read]
      |\____________________
      |                     |
      | response.read()     | putrequest()
      v                     v
    Idle                  Req-started-unread-response
                     ______/|
                   /        |
   response.read() |        | ( putheader() )*  endheaders()
                   v        v
       Request-started    Req-sent-unread-response
                            |
                            | response.read()
                            v
                          Request-sent

This diagram presents the following rules:
  -- a second request may not be started until {response-headers-read}
  -- a response [object] cannot be retrieved until {request-sent}
  -- there is no differentiation between an unread response body and a
     partially read response body

Note: this enforcement is applied by the HTTPConnection class. The
      HTTPResponse class does not enforce this state machine, which
      implies sophisticated clients may accelerate the request/response
      pipeline. Caution should be taken, though: accelerating the states
      beyond the above pattern may imply knowledge of the server's
      connection-close behavior for certain requests. For example, it
      is impossible to tell whether the server will close the connection
      UNTIL the response headers have been read; this means that further
      requests cannot be placed into the pipeline until it is known that
      the server will NOT be closing the connection.

Logical State                  __state            __response
-------------                  -------            ----------
Idle                           _CS_IDLE           None
Request-started                _CS_REQ_STARTED    None
Request-sent                   _CS_REQ_SENT       None
Unread-response                _CS_IDLE           <response_class>
Req-started-unread-response    _CS_REQ_STARTED    <response_class>
Req-sent-unread-response       _CS_REQ_SENT       <response_class>
i(tabsolute_importtdivisiontprint_functiontunicode_literals(tbytestinttstrtsuper(tPY2(tparser(tmessage(tcreate_connectionN(turlsplit(tarrayuHTTPResponseuHTTPConnectionu
HTTPExceptionuNotConnecteduUnknownProtocoluUnknownTransferEncodinguUnimplementedFileModeuIncompleteReadu
InvalidURLuImproperConnectionStateuCannotSendRequestuCannotSendHeaderuResponseNotReadyu
BadStatusLineuerroru	responsesiPi�uUNKNOWNuIdleuRequest-starteduRequest-sentidieifi�i�i�i�i�i�i�i�i�i,i-i.i/i0i1i3i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�uContinueuSwitching ProtocolsuOKuCreateduAccepteduNon-Authoritative Informationu
No Contentu
Reset ContentuPartial ContentuMultiple ChoicesuMoved PermanentlyuFoundu	See OtheruNot Modifiedu	Use Proxyu(Unused)i2uTemporary RedirectuBad RequestuUnauthorizeduPayment Requiredu	Forbiddenu	Not FounduMethod Not AlloweduNot AcceptableuProxy Authentication RequireduRequest TimeoutuConflictuGoneuLength RequireduPrecondition FaileduRequest Entity Too LargeuRequest-URI Too LonguUnsupported Media TypeuRequested Range Not SatisfiableuExpectation FaileduPrecondition RequireduToo Many RequestsuRequest Header Fields Too LargeuInternal Server ErroruNot ImplementeduBad GatewayuService UnavailableuGateway TimeoutuHTTP Version Not SupporteduNetwork Authentication RequirediitHTTPMessagecB`seZd�ZRS(cC`s�|j�d}t|�}g}d}xb|j�D]T}|| j�|krZd}n|d j�ssd}n|r5|j|�q5q5W|S(u�Find all header lines matching a given header name.

        Look through the list of headers and find all lines matching a given
        header name (and their continuation lines).  A list of the lines is
        returned, without interpretation.  If the header does not occur, an
        empty list is returned.  If the header occurs multiple times, all
        occurrences are returned.  Case is not important in the header name.

        u:ii(tlowertlentkeystisspacetappend(tselftnametntlstthittline((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pytgetallmatchingheaders�s
		(t__name__t
__module__R(((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyR�scC`s�g}x�tr�|jtd�}t|�tkrCtd��n|j|�t|�tkrutdt��n|d	kr	Pq	q	Wtd�j	|�j
d�}tjd|�j
|�S(
uGParses only RFC2822 headers from a file pointer.

    email Parser wants to see strings rather than bytes.
    But a TextIOWrapper around self.rfile would buffer too many bytes
    from the stream, bytes which we later need to read as bytes.
    So we read the correct bytes here, as bytes, for email Parser
    to parse.

    iuheader lineugot more than %d headerss
s
tu
iso-8859-1t_class(s
s
R(tTruetreadlinet_MAXLINERtLineTooLongRt_MAXHEADERSt
HTTPExceptionRtjointdecodetemail_parsertParsertparsestr(tfpRtheadersRthstring((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyt
parse_headerss
	
tHTTPResponsecB`s�eZdeddd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zdd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zdd�Zd�Zd�Zd�Zd�Zd�ZRS(icC`s�|jd�|_||_|tk	r=tjdtd�n||_d|_	|_
t|_t|_
t|_t|_t|_t|_t|_dS(Nurbuithe 'strict' argument isn't supported anymore; http.client now always assumes HTTP/1.x compliant servers.i(tmakefileR*t
debuglevelt_strict_sentineltwarningstwarntDeprecationWarningt_methodtNoneR+tmsgt_UNKNOWNtversiontstatustreasontchunkedt
chunk_lefttlengtht
will_close(RtsockR0tstricttmethodturl((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyt__init__&s		
							cC`sut|jjtd�d�}t|�tkr@td��n|jdkretdt|��n|szt	|��ny|j
dd�\}}}WnMtk
r�y"|j
dd�\}}d}Wq�tk
r�d}q�XnX|j
d�s|j�t	|��ny7t|�}|d	ks8|d
krGt	|��nWntk
rgt	|��nX|||fS(Niu
iso-8859-1ustatus lineiureply:iuuHTTP/idi�(RR*R R!RR"R0tprinttreprt
BadStatusLinetsplitR6t
ValueErrort
startswitht_close_connR(RRR9R:R;((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyt_read_statusHs2




cC`s�|jdk	rdSx�tr�|j�\}}}|tkrAPnxvtr�|jjtd�}t|�tkr�t	d��n|j
�}|s�Pn|jdkrDtd|�qDqDWqW||_
|_|j
�|_|dkr�d|_n'|jd�rd	|_nt|��t|j�|_|_|jdkrnx'|jD]}td|d
d�qNWn|jjd�}|r�|j�d
kr�t|_d|_n	t|_|j�|_d|_|jjd�}|jjd�}|rP|jrPyt|�|_Wntk
r1d|_qYX|jdkrYd|_qYn	d|_|tks�|t ks�d|ko�dkns�|j!dkr�d|_n|jr�|jr�|jdkr�t|_ndS(Niuheader lineiuheader:uHTTP/1.0uHTTP/0.9i
uHTTP/1.itendu utransfer-encodinguchunkeducontent-lengthidi�uHEAD(uHTTP/1.0uHTTP/0.9("R+R6RRLtCONTINUER*R R!RR"tstripR0REtcodeR:R;R9RJtUnknownProtocolR-R7tgetRR<R=tFalset_check_closeR?R>RRIt
NO_CONTENTtNOT_MODIFIEDR5(RR9R:R;tskipthdrttr_encR>((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pytbeginhsf					

	

cC`s�|jjd�}|jdkrS|jjd�}|rOd|j�krOtStS|jjd�ritS|r�d|j�kr�tS|jjd�}|r�d|j�kr�tStS(Nu
connectioniucloseu
keep-aliveuproxy-connection(R+RRR9RRRS(Rtconntpconn((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyRT�scC`s |j}d|_|j�dS(N(R*R6tclose(RR*((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyRK�s		cC`s't�j�|jr#|j�ndS(N(RR]R*RK(R((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyR]�s
	cC`s*t�j�|jr&|jj�ndS(N(RtflushR*(R((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyR^�s
	cC`stS(N(R(R((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pytreadable�scC`s
|jdkS(u!True if the connection is closed.N(R*R6(R((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pytisclosed�scC`s�|jdkrtd�S|jdkr<|j�td�S|dk	rdttt|�j|��S|jrw|j	�S|j
dkr�|jj�}n@y|j|j
�}Wntk
r�|j��nXd|_
|j�t|�SdS(NRuHEADi(
R*R6RR5RKRR.treadR<t_readall_chunkedR>t
_safe_readtIncompleteRead(Rtamtts((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyRa�s&


	


	
cC`s$|jdkrdS|jdkr0|j�dS|jrF|j|�S|jdk	r�t|�|jkr�t|�d|j!}q�nt	r�|jj
t|��}t|�}|||*n|jj|�}|r�|r�|j�n7|jdk	r |j|8_|js |j�q n|S(NiuHEAD(R*R6R5RKR<t_readinto_chunkedR>Rt
memoryviewRRatreadinto(RtbtdataR((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyRis,
	



	cC`s�|jjtd�}t|�tkr7td��n|jd�}|dkr_|| }nyt|d�SWntk
r�|j��nXdS(Niu
chunk sizet;ii(	R*R R!RR"tfindRRIRK(RRti((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyt_read_next_chunk_size=s


cC`sbx[tr]|jjtd�}t|�tkr@td��n|sJPn|dkrPqqWdS(Niutrailer lines
s
R(s
s
R(RR*R R!RR"(RR((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyt_read_and_discard_trailerMs	cC`s�|j}g}x�tr�|dkrvy |j�}|dkrCPnWqvtk
rrttd�j|���qvXn|j|j	|��|j	d�d}qW|j
�|j�td�j|�S(NiRi(R=RR6RoRIRdRR%RRcRpRK(RR=tvalue((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyRb[s 		
"



cC`sT|j}d}t|�}xtr;|dkr�y |j�}|dkrOPnWq�tk
r|tt|d|!���q�Xnt|�|kr�|j	|�}|||_||St|�|kr�|j	|�}|j
d�d|_||S|d|!}|j	|�}||}||7}|j
d�d}qW|j�|j�|S(Nii(
R=RhRR6RoRIRdRRt_safe_readintoRcRpRK(RRjR=ttotal_bytestmvbRttemp_mvb((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyRgts:		
 

	






cC`s�g}xo|dkrw|jjt|t��}|sWttd�j|�|��n|j|�|t|�8}q	Wtd�j|�S(uVRead the number of bytes requested, compensating for partial reads.

        Normally, we have a blocking socket, but a read() can be interrupted
        by a signal (resulting in a partial read).

        Note that we cannot distinguish between EOF and an interrupt when zero
        bytes have been read. IncompleteRead() will be raised in this
        situation.

        This function should be used when <amt> bytes "should" be present for
        reading. If the bytes are truly not available (due to EOF), then the
        IncompleteRead exception can be used to detect the problem.
        iR(	R*Ratmint	MAXAMOUNTRdRR%RR(RReRftchunk((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyRc�s!
cC`s�d}t|�}x�|t|�kr�tt|�kr[|dt!}|jj|�}n|jj|�}|s�tt|d|!�t|���n||}||7}qW|S(u2Same as _safe_read, but for reading into a buffer.i(RhRRwR*RiRdR(RRjRsRtRuR((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyRr�s
%
cC`s
|jj�S(N(R*tfileno(R((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyRy�scC`sg|jdkrt��n|jj|�p0|}t|t�sRt|d�rV|Sdj|�SdS(Nu__iter__u, (R+R6tResponseNotReadytget_allt
isinstanceRthasattrR%(RRtdefaultR+((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyt	getheader�scC`s.|jdkrt��nt|jj��S(u&Return list of (header, value) tuples.N(R+R6Rztlisttitems(R((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyt
getheaders�scC`s|S(N((R((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyt__iter__�scC`s|jS(N(R+(R((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pytinfo�scC`s|jS(N(RC(R((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pytgeturl�scC`s|jS(N(R:(R((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pytgetcode�sN(RRR1R6RDRLRZRTRKR]R^R_R`RaRiRoRpRbRgRcRrRyRR�R�R�R�R�(((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyR.s0	"	 	P			
			
	%				)								tHTTPConnectioncB`s�eZdZdZeZeZdZdZ	deej
dd�Zddd�Zd�Zd�Zd�Zd	�Zd
�Zd�Zd�Zdd
�Zddd�Zd�Zdd�Zdid�Zd�Zd�Zd�ZRS(iuHTTP/1.1iicC`s�|tk	r"tjdtd�n||_||_d|_g|_d|_	t
|_d|_d|_
d|_i|_|j||�dS(Nuithe 'strict' argument isn't supported anymore; http.client now always assumes HTTP/1.x compliant servers.i(R1R2R3R4ttimeouttsource_addressR6R@t_buffert_HTTPConnection__responset_CS_IDLEt_HTTPConnection__stateR5t_tunnel_hostt_tunnel_portt_tunnel_headerst
_set_hostport(RthosttportRAR�R�((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyRD�s	
										cC`s5||_||_|r$||_n
|jj�dS(u� Sets up the host and the port for the HTTP CONNECT Tunnelling.

        The headers argument should be a mapping of extra HTTP headers
        to send with the CONNECT request.
        N(R�R�R�tclear(RR�R�R+((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyt
set_tunnels
		cC`s�|dkr�|jd�}|jd�}||kr�yt||d�}WnItk
r�||ddkr~|j}q�td||d��nX|| }n	|j}|r�|ddkr�|ddkr�|dd!}q�n||_||_dS(	Nu:u]iuunonnumeric port: '%s'iu[i����(R6trfindRRItdefault_portt
InvalidURLR�R�(RR�R�Rntj((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyR�s 

	&	cC`s
||_dS(N(R0(Rtlevel((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pytset_debuglevel$scC`sq|j|j|j�d|j|jf}|jd�}|j|�xI|jj�D]8\}}d||f}|jd�}|j|�qXW|jt	d��|j
|jd|j�}|j
�\}}	}
|	dkr|j�tjd|	|
j�f��nx[trl|jjtd	�}t|�tkrOtd
��n|sYPn|d
krPqqWdS(NuCONNECT %s:%d HTTP/1.0
uasciiu%s: %s
ulatin-1s
RBi�uTunnel connection failed: %d %siuheader lines
R(s
s
R(R�R�R�R�R�tencodetsendR�R�Rtresponse_classR@R5RLR]tsocketterrorRORR*R R!RR"(Rtconnect_strt
connect_bytestheaderRqt
header_strtheader_bytestresponseR9RPR
R((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyt_tunnel's.

	cC`sAt|j|jf|j|j�|_|jr=|j�ndS(u3Connect to the host and port specified in __init__.N(tsocket_create_connectionR�R�R�R�R@R�R�(R((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pytconnectCs	cC`sQ|jr"|jj�d|_n|jrD|jj�d|_nt|_dS(u(Close the connection to the HTTP server.N(R@R]R6R�R�R�(R((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyR]Js	
	
cC`s�|jd	kr1|jr%|j�q1t��n|jdkrVtdt|��nd}t|d�r;t	|t
�r;|jdkr�td�nt}y
|j}Wnt
k
r�n2Xd|kr�t}|jdkr�td�q�nxE|j|�}|sPn|r#|jd�}n|jj|�q�Wd	Sy|jj|�Wn]tk
r�t	|tj�r�x7|D]}|jj|�qxWq�td
t|���nXd	S(u�Send `data' to the server.
        ``data`` can be a string object, a bytes object, an array object, a
        file-like object that supports a .read() method, or an iterable object.
        iusend:i ureadusendIng a read()ableubuencoding file using iso-8859-1u
iso-8859-1Nu9data should be a bytes-like object or an iterable, got %r(R@R6t	auto_openR�tNotConnectedR0RERFR}R|R
RStmodetAttributeErrorRRaR�tsendallt	TypeErrortcollectionstIterablettype(RRkt	blocksizeR�R�t	datablocktd((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyR�TsF	





cC`s|jj|�dS(uuAdd a line of output to the current request buffer.

        Assumes that the line does *not* end with \r\n.
        N(R�R(RRf((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyt_output�scC`s�|jjtd�td�f�td�j|j�}|j2t|t�rc||7}d}n|j|�|dk	r�|j|�ndS(u�Send the currently buffered request and clear the buffer.

        Appends an extra \r\n to the buffer.
        A message_body may be specified, to be appended to the request.
        Rs
N(R�textendRR%R|R6R�(Rtmessage_bodyR7((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyt_send_output�s"
	
c
C`s|jr$|jj�r$d|_n|jtkr?t|_nt|j��||_|sfd}nd|||jf}|j	|j
d��|jdkr|s�d}|jd�r�t
|�\}}}}}n|r)y|j
d�}Wn tk
r|j
d�}nX|jd|�q�y|jj
d�}	Wn#tk
rd|jj
d�}	nX|jjd	�d
kr�td|	d�}	n|j|jkr�|jd|	�q�|	jd�}	|jdd
|	|jf�n|s|jdd�qndS(u`Send a request to the server.

        `method' specifies an HTTP request method, e.g. 'GET'.
        `url' specifies the object being requested, e.g. '/index.html'.
        `skip_host' if True does not add automatically a 'Host:' header
        `skip_accept_encoding' if True does not add automatically an
           'Accept-Encoding:' header
        u/u%s %s %suasciiiuuhttpuidnauHostu:it[t]u%s:%suAccept-EncodinguidentityN(R�R`R6R�R�t_CS_REQ_STARTEDtCannotSendRequestR5t
_http_vsn_strR�R�t	_http_vsnRJRtUnicodeEncodeErrort	putheaderR�RmRR�R�R&(
RRBRCt	skip_hosttskip_accept_encodingtrequesttnetloctnilt
netloc_encthost_enc((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyt
putrequest�sD		

 
cG`s�|jtkrt��nt|d�r<|jd�}nt|�}xjt|�D]\\}}t|d�r�|jd�||<qUt|t�rUt	|�jd�||<qUqUWt
d�j|�}|t
d�|}|j|�dS(ukSend a request header line to the server.

        For example: h.putheader('Accept', 'text/html')
        uencodeuasciiulatin-1s
	s: N(
R�R�tCannotSendHeaderR}R�R�t	enumerateR|RRRR%R�(RR�tvaluesRnt	one_valueRq((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyR�s cC`s5|jtkrt|_n	t��|j|�dS(u�Indicate that the last header line has been sent to the server.

        This method sends the request to the server.  The optional message_body
        argument can be used to pass a message body associated with the
        request.  The message body will be sent in the same packet as the
        message headers if it is a string, otherwise it is sent as a separate
        packet.
        N(R�R�t_CS_REQ_SENTR�R�(RR�((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyt
endheaders*s		cC`s|j||||�dS(u&Send a complete request to the server.N(t
_send_request(RRBRCtbodyR+((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyR�9scC`s�d}ytt|��}Wnktk
r�}y"ttj|j��j�}Wq�tt	fk
r�|j
dkr�td�q�q�XnX|dk	r�|jd|�ndS(Niu
Cannot stat!!uContent-Length(
R6RRR�tostfstatRytst_sizeR�tOSErrorR0RER�(RR�tthelentte((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyt_set_content_length=s"c
C`s�tjg|D]}|j�^q
�}i}d|krGd|d<nd|kr`d|d<n|j|||�|dk	r�d|kr�|j|�nx*|j�D]\}}	|j||	�q�Wt|t	�r�|j
d�}n|j|�dS(Nuhostiu	skip_hostuaccept-encodinguskip_accept_encodingucontent-lengthu
iso-8859-1(tdicttfromkeysRR�R6R�R�R�R|RR�R�(
RRBRCR�R+tktheader_namestskipsRXRq((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyR�Ns(

cC`s�|jr$|jj�r$d|_n|jtks<|jrNt|j��n|jdkr�|j|j|jd|j	�}n|j|jd|j	�}|j
�t|_|jr�|j
�n	||_|S(u/Get the response from the server.

        If the HTTPConnection is in the correct state, returns an
        instance of HTTPResponse or of whatever object is returned by
        class the response_class variable.

        If a request has not been sent or if a previous response has
        not be handled, ResponseNotReady is raised.  If the HTTP
        response indicates that the connection should be closed, then
        it will be closed before the response is returned.  When the
        connection is closed, the underlying socket is closed.
        iRBN(R�R`R6R�R�RzR0R�R@R5RZR�R?R](RR�((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pytgetresponsecs
		
	N(RRR�R�R.R�t	HTTP_PORTR�R�R0R6R1R�t_GLOBAL_DEFAULT_TIMEOUTRDR�R�R�R�R�R]R�R�R�R�R�R�R�R�R�R�(((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyR��s0
					
	2	t			(t
SSLContexttHTTPSConnectioncB`s;eZdZeZdddeejdd�Z	d�Z
RS(u(This class allows communication via SSL.cK`s+d|kr |d}	|d=nd}	d|krF|d}
|d=nd}
tt|�j|||||�||_||_|
dkr�tjtj�}
|
j	tj
O_	n|
jtjk}|	dkr�|}	n|	r�|r�t
d��n|s|r|
j||�n|
|_|	|_dS(Nucheck_hostnameucontextuMcheck_hostname needs a SSL context with either CERT_OPTIONAL or CERT_REQUIRED(R6RR�RDtkey_filet	cert_filetsslR�tPROTOCOL_SSLv23toptionstOP_NO_SSLv2tverify_modet	CERT_NONERItload_cert_chaint_contextt_check_hostname(RR�R�R�R�RAR�R�t_3to2kwargstcheck_hostnametcontexttwill_verify((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyRD�s0



			
	cC`s�t|j|jf|j|j�}|jrC||_|j�ntj	rU|jnd}|jj|d|�|_y,|j
r�tj|jj�|j�nWn4tk
r�|jjtj�|jj��nXdS(u(Connect to a host on a given (SSL) port.tserver_hostnameN(R�R�R�R�R�R�R@R�R�tHAS_SNIR6R�twrap_socketR�tmatch_hostnametgetpeercertt	ExceptiontshutdownR�t	SHUT_RDWRR](RR@R�((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyR��s		
	#

N(RRt__doc__t
HTTPS_PORTR�R6R1R�R�RDR�(((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyR��s		uHTTPSConnectionR$cB`seZRS((RR(((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyR$�sR�cB`seZRS((RR(((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyR��sR�cB`seZRS((RR(((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyR��sRQcB`seZd�ZRS(cC`s|f|_||_dS(N(targsR9(RR9((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyRDs(RRRD(((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyRQstUnknownTransferEncodingcB`seZRS((RR(((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyR�stUnimplementedFileModecB`seZRS((RR(((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyR�
sRdcB`s&eZdd�Zd�Zd�ZRS(cC`s"|f|_||_||_dS(N(R�tpartialtexpected(RR�R((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyRDs	cC`s<|jdk	rd|j}nd}dt|j�|fS(Nu, %i more expecteduuIncompleteRead(%i bytes read%s)(RR6RR�(Rte((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyt__repr__scC`s
t|�S(N(RF(R((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyt__str__sN(RRR6RDRR(((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyRd
s	tImproperConnectionStatecB`seZRS((RR(((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyRsR�cB`seZRS((RR(((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyR�sR�cB`seZRS((RR(((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyR�!sRzcB`seZRS((RR(((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyRz$sRGcB`seZd�ZRS(cC`s.|st|�}n|f|_||_dS(N(RFR�R(RR((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyRD(s(RRRD(((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyRG'sR"cB`seZd�ZRS(cC`stj|dt|f�dS(Nu&got more than %d bytes when reading %s(R$RDR!(Rt	line_type((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyRD/s(RRRD(((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyR".s(yR�t
__future__RRRRtfuture.builtinsRRRRtfuture.utilsRtfuture.backports.emailR	R'R
t
email_messagetfuture.backports.miscRR�tioR�R�R�tfuture.backports.urllib.parseRR2R
t__all__R�R�R8R�R�R�RNtSWITCHING_PROTOCOLSt
PROCESSINGtOKtCREATEDtACCEPTEDtNON_AUTHORITATIVE_INFORMATIONRUt
RESET_CONTENTtPARTIAL_CONTENTtMULTI_STATUStIM_USEDtMULTIPLE_CHOICEStMOVED_PERMANENTLYtFOUNDt	SEE_OTHERRVt	USE_PROXYtTEMPORARY_REDIRECTtBAD_REQUESTtUNAUTHORIZEDtPAYMENT_REQUIREDt	FORBIDDENt	NOT_FOUNDtMETHOD_NOT_ALLOWEDtNOT_ACCEPTABLEtPROXY_AUTHENTICATION_REQUIREDtREQUEST_TIMEOUTtCONFLICTtGONEtLENGTH_REQUIREDtPRECONDITION_FAILEDtREQUEST_ENTITY_TOO_LARGEtREQUEST_URI_TOO_LONGtUNSUPPORTED_MEDIA_TYPEtREQUESTED_RANGE_NOT_SATISFIABLEtEXPECTATION_FAILEDtUNPROCESSABLE_ENTITYtLOCKEDtFAILED_DEPENDENCYtUPGRADE_REQUIREDtPRECONDITION_REQUIREDtTOO_MANY_REQUESTStREQUEST_HEADER_FIELDS_TOO_LARGEtINTERNAL_SERVER_ERRORtNOT_IMPLEMENTEDtBAD_GATEWAYtSERVICE_UNAVAILABLEtGATEWAY_TIMEOUTtHTTP_VERSION_NOT_SUPPORTEDtINSUFFICIENT_STORAGEtNOT_EXTENDEDtNETWORK_AUTHENTICATION_REQUIREDt	responsesRwR!R#tMessageRR-tobjectR1t	RawIOBaseR.R�R�R�tImportErrorR�RR�R$R�R�RQR�R�RdRR�R�RzRGR"R�(((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/client.pyt<module>Es6""			
	����
6
!

Zerion Mini Shell 1.0