AlkantarClanX12

Your IP : 18.191.223.23


Current Path : /proc/self/root/opt/alt/python33/lib64/python3.3/http/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python33/lib64/python3.3/http/__pycache__/client.cpython-33.pyo

�
��f
�c@sUdZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddlZdddddd	d
ddd
ddddddgZdZ
dZdZdZdZdZdZdZdZdZdZdZd Zd!Zd"Zd#Zd$Zd%Zd&Zd'Z d(Z!d)Z"d*Z#d+Z$d,Z%d-Z&d.Z'd/Z(d0Z)d1Z*d2Z+d3Z,d4Z-d5Z.d6Z/d7Z0d8Z1d9Z2d:Z3d;Z4d<Z5d=Z6d>Z7d?Z8d@Z9dAZ:dBZ;dCZ<dDZ=dEZ>dFZ?dGZ@dHZAdIZBdJZCdKZDdLZEdMZFdNZGi-dOd6dPd6dQd6dRd6dSd6dTd 6dUd!6dVd"6dWd#6dXd&6dYd'6dZd(6d[d)6d\d*6d]d+6d^d_6d`d,6dad-6dbd.6dcd/6ddd06ded16dfd26dgd36dhd46did56djd66dkd76dld86dmd96dnd:6dod;6dpd<6dqd=6drd>6dsdC6dtdD6dudE6dvdF6dwdG6dxdH6dydI6dzdJ6d{dK6d|dN6ZHd}ZId~ZJdZKejLd�jMZNejLd��jOZPGd�d��d�ejQjR�ZSeSd�d��ZTeU�ZVGd�d�dejW�ZXGd�d�d�ZYyddlZZZWne[k
r	Yn$XGd�d��d�eY�Z\ej]d��Gd�d�de^�Z_Gd�d�de_�Z`Gd�d�de_�ZaGd�d�de_�ZbGd�d	�d	e_�ZcGd�d
�d
e_�ZdGd�d�de_�ZeGd�d
�d
e_�ZfGd�d�def�ZgGd�d�def�ZhGd�d�def�ZiGd�d�de_�ZjGd�d��d�e_�Zke_ZldS(�u�	HTTP/1.1 client library

<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>
iN(uurlsplitu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 Requirediis[^:\s][^:\r\n]*\Zs\n(?![ \t])|\r(?![ \t\n])cBs |EeZdZdd�ZdS(uHTTPMessagecCs�|j�d}t|�}g}d}xn|j�D]`}|d|�j�|kr`d}n|dd�j�sd}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:iNi(ulowerulenukeysuisspaceuappend(uselfunameunulstuhituline((u0/opt/alt/python33/lib64/python3.3/http/client.pyugetallmatchingheaderss
		u!HTTPMessage.getallmatchingheadersN(u__name__u
__module__u__qualname__ugetallmatchingheaders(u
__locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyuHTTPMessage�suHTTPMessagecCs�g}xy|jtd�}t|�tkr=td��n|j|�t|�tkrotdt��n|d	kr	Pq	q	dj|�jd�}t	j
jd|�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
su
iso-8859-1u_class(s
s
s(
ureadlineu_MAXLINEulenuLineTooLonguappendu_MAXHEADERSu
HTTPExceptionujoinudecodeuemailuparseruParseruparsestr(ufpu_classuheadersulineuhstring((u0/opt/alt/python33/lib64/python3.3/http/client.pyu
parse_headerss

u
parse_headerscsX|EeZdZded2d2dd�Zdd�Zdd�Zdd	�Zd
d�Z	�fdd
�Z
�fdd�Zdd�Zdd�Z
d2�fdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd2d&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Z�S(3uHTTPResponseicCs�|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(umakefileufpu
debuglevelu_strict_sentineluwarningsuwarnuDeprecationWarningu_methoduNoneuheadersumsgu_UNKNOWNuversionustatusureasonuchunkedu
chunk_leftulengthu
will_close(uselfusocku
debuglevelustrictumethoduurl((u0/opt/alt/python33/lib64/python3.3/http/client.pyu__init__:s		
							uHTTPResponse.__init__cCsxt|jjtd�d�}t|�tkr@td��n|jdkretdt|��n|szt	|��ny|j
dd�\}}}WnOtk
r�y"|j
dd�\}}d}Wntk
r�d}YnXYnX|j
d�s|j�t	|��ny7t|�}|d	ks:|d
krIt	|��nWntk
rjt	|��YnX|||fS(Niu
iso-8859-1ustatus lineiureply:iuuHTTP/idi�(ustrufpureadlineu_MAXLINEulenuLineTooLongu
debugleveluprinturepru
BadStatusLineusplituNoneu
ValueErroru
startswithu_close_connuint(uselfulineuversionustatusureason((u0/opt/alt/python33/lib64/python3.3/http/client.pyu_read_status\s2




uHTTPResponse._read_statuscCs�|jdk	rdSx�|j�\}}}|tkr;Pnxo|jjtd�}t|�tkrutd��n|j	�}|s�Pn|j
dkr>td|�q>q>q||_|_
|j	�|_|dkr�d|_n'|jd�rd	|_nt|��t|j�|_|_|j
dkr`x'|jD]}td|d
d�q@Wn|jjd�}|r�|j�d
kr�d|_d|_n	d|_|j�|_d|_|jjd�}|jjd�}|rC|jrCyt|�|_Wntk
r$d|_YqLX|jdkrLd|_qLn	d|_|tks�|t ks�d|ko{dkns�|j!dkr�d|_n|jr�|jr�|jdkr�d|_ndS(Niuheader lineiuheader:uHTTP/1.0uHTTP/0.9i
uHTTP/1.iuendu utransfer-encodinguchunkeducontent-lengthidi�uHEAD(uHTTP/1.0uHTTP/0.9TF("uheadersuNoneu_read_statusuCONTINUEufpureadlineu_MAXLINEulenuLineTooLongustripu
debugleveluprintucodeustatusureasonuversionu
startswithuUnknownProtocolu
parse_headersumsgugetuloweruTrueuchunkedu
chunk_leftuFalseu_check_closeu
will_closeulengthuintu
ValueErroru
NO_CONTENTuNOT_MODIFIEDu_method(uselfuversionustatusureasonuskipuhdrutr_enculength((u0/opt/alt/python33/lib64/python3.3/http/client.pyubegin|sf			
	

uHTTPResponse.begincCs�|jjd�}|jdkrS|jjd�}|rOd|j�krOdSdS|jjd�ridS|r�d|j�kr�dS|jjd�}|r�d|j�kr�dSdS(Nu
connectioniucloseu
keep-aliveuproxy-connectionTF(uheadersugetuversionuloweruTrueuFalse(uselfuconnupconn((u0/opt/alt/python33/lib64/python3.3/http/client.pyu_check_close�suHTTPResponse._check_closecCs |j}d|_|j�dS(N(ufpuNoneuclose(uselfufp((u0/opt/alt/python33/lib64/python3.3/http/client.pyu_close_conn�s		uHTTPResponse._close_conncs't�j�|jr#|j�ndS(N(usuperucloseufpu_close_conn(uself(u	__class__(u0/opt/alt/python33/lib64/python3.3/http/client.pyuclose�s
	uHTTPResponse.closecs*t�j�|jr&|jj�ndS(N(usuperuflushufp(uself(u	__class__(u0/opt/alt/python33/lib64/python3.3/http/client.pyuflush�s
	uHTTPResponse.flushcCsdS(NT(uTrue(uself((u0/opt/alt/python33/lib64/python3.3/http/client.pyureadable�suHTTPResponse.readablecCs
|jdkS(u!True if the connection is closed.N(ufpuNone(uself((u0/opt/alt/python33/lib64/python3.3/http/client.pyuisclosedsuHTTPResponse.isclosedcs�|jdkrdS|jdkr0|j�dS|dk	rRtt|�j|�S|jre|j�S|j	dkr�|jj�}nAy|j
|j	�}Wntk
r�|j��YnXd|_	|j�|SdS(NsuHEADi(ufpuNoneu_methodu_close_connusuperuHTTPResponseureaduchunkedu_readall_chunkedulengthu
_safe_readuIncompleteRead(uselfuamtus(u	__class__(u0/opt/alt/python33/lib64/python3.3/http/client.pyuread
s&
	


	
uHTTPResponse.readcCs�|jdkrdS|jdkr0|j�dS|jrF|j|�S|jdk	r�t|�|jkr�t|�d|j�}q�n|jj	|�}|r�|r�|j�n7|jdk	r�|j|8_|js�|j�q�n|S(NiuHEAD(
ufpuNoneu_methodu_close_connuchunkedu_readinto_chunkedulengthulenu
memoryviewureadinto(uselfubun((u0/opt/alt/python33/lib64/python3.3/http/client.pyureadinto,s$
	


	uHTTPResponse.readintocCs�|jjtd�}t|�tkr7td��n|jd�}|dkre|d|�}nyt|d�SWntk
r�|j��YnXdS(Niu
chunk sizes;ii(	ufpureadlineu_MAXLINEulenuLineTooLongufinduintu
ValueErroru_close_conn(uselfulineui((u0/opt/alt/python33/lib64/python3.3/http/client.pyu_read_next_chunk_sizeJs

u"HTTPResponse._read_next_chunk_sizecCs[xT|jjtd�}t|�tkr:td��n|sDPn|dkrPqqdS(Niutrailer lines
s
s(s
s
s(ufpureadlineu_MAXLINEulenuLineTooLong(uselfuline((u0/opt/alt/python33/lib64/python3.3/http/client.pyu_read_and_discard_trailerZsu&HTTPResponse._read_and_discard_trailercCs�|j}g}x�|dkrky |j�}|dkr=PnWqktk
rgtdj|���YqkXn|j|j|��|jd�d}q|j�|j	�dj|�S(Nisi(
u
chunk_leftuNoneu_read_next_chunk_sizeu
ValueErroruIncompleteReadujoinuappendu
_safe_readu_read_and_discard_traileru_close_conn(uselfu
chunk_leftuvalue((u0/opt/alt/python33/lib64/python3.3/http/client.pyu_readall_chunkedhs 	

	

uHTTPResponse._readall_chunkedcCsZ|j}d}t|�}x$|dkr~y |j�}|dkrIPnWq~tk
rztt|d|����Yq~Xnt|�|kr�|j|�}|||_||St|�|kr�|j|�}|j	d�d|_||S|d|�}|j|�}||d�}||7}|j	d�d}q|j
�|j�|S(Nii(u
chunk_leftu
memoryviewuNoneu_read_next_chunk_sizeu
ValueErroruIncompleteReadubytesulenu_safe_readintou
_safe_readu_read_and_discard_traileru_close_conn(uselfubu
chunk_leftutotal_bytesumvbunutemp_mvb((u0/opt/alt/python33/lib64/python3.3/http/client.pyu_readinto_chunked�s:	
$

	

	

uHTTPResponse._readinto_chunkedcCsg}xi|dkrq|jjt|t��}|sQtdj|�|��n|j|�|t|�8}q	Wdj|�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.
        is(ufpureaduminu	MAXAMOUNTuIncompleteReadujoinuappendulen(uselfuamtusuchunk((u0/opt/alt/python33/lib64/python3.3/http/client.pyu
_safe_read�s
uHTTPResponse._safe_readcCs�d}t|�}x�|t|�kr�tt|�kr^|dt�}|jj|�}n|jj|�}|s�tt|d|��t|���n||d�}||7}qW|S(u2Same as _safe_read, but for reading into a buffer.iN(u
memoryviewulenu	MAXAMOUNTufpureadintouIncompleteReadubytes(uselfubutotal_bytesumvbutemp_mvbun((u0/opt/alt/python33/lib64/python3.3/http/client.pyu_safe_readinto�s(uHTTPResponse._safe_readintocCs
|jj�S(N(ufpufileno(uself((u0/opt/alt/python33/lib64/python3.3/http/client.pyufileno�suHTTPResponse.filenocCsg|jdkrt��n|jj|�p0|}t|t�sRt|d�rV|Sdj|�SdS(Nu__iter__u, (uheadersuNoneuResponseNotReadyuget_allu
isinstanceustruhasattrujoin(uselfunameudefaultuheaders((u0/opt/alt/python33/lib64/python3.3/http/client.pyu	getheader�suHTTPResponse.getheadercCs.|jdkrt��nt|jj��S(u&Return list of (header, value) tuples.N(uheadersuNoneuResponseNotReadyulistuitems(uself((u0/opt/alt/python33/lib64/python3.3/http/client.pyu
getheaders�suHTTPResponse.getheaderscCs|S(N((uself((u0/opt/alt/python33/lib64/python3.3/http/client.pyu__iter__�suHTTPResponse.__iter__cCs|jS(N(uheaders(uself((u0/opt/alt/python33/lib64/python3.3/http/client.pyuinfo�suHTTPResponse.infocCs|jS(N(uurl(uself((u0/opt/alt/python33/lib64/python3.3/http/client.pyugeturl�suHTTPResponse.geturlcCs|jS(N(ustatus(uself((u0/opt/alt/python33/lib64/python3.3/http/client.pyugetcode�suHTTPResponse.getcodeN(u__name__u
__module__u__qualname__u_strict_sentineluNoneu__init__u_read_statusubeginu_check_closeu_close_connucloseuflushureadableuisclosedureadureadintou_read_next_chunk_sizeu_read_and_discard_traileru_readall_chunkedu_readinto_chunkedu
_safe_readu_safe_readintoufilenou	getheaderu
getheadersu__iter__uinfougeturlugetcode(u
__locals__((u	__class__u0/opt/alt/python33/lib64/python3.3/http/client.pyuHTTPResponse1s0	" P

)	cBs+|EeZdZdZdZeZeZdZ	dZ
d'ee
jd'dd�Zd'd'dd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Zdd�Zdd�Zd'dd�Zdddd�Zdd�Zd'dd�Zd'idd �Zd!d"�Zd#d$�Zd%d&�Zd'S((uHTTPConnectioniuHTTP/1.1iicCs�|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(u_strict_sentineluwarningsuwarnuDeprecationWarningutimeoutusource_addressuNoneusocku_bufferu_HTTPConnection__responseu_CS_IDLEu_HTTPConnection__stateu_methodu_tunnel_hostu_tunnel_portu_tunnel_headersu
_set_hostport(uselfuhostuportustrictutimeoutusource_address((u0/opt/alt/python33/lib64/python3.3/http/client.pyu__init__�s	
										uHTTPConnection.__init__cCs5||_||_|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(u_tunnel_hostu_tunnel_portu_tunnel_headersuclear(uselfuhostuportuheaders((u0/opt/alt/python33/lib64/python3.3/http/client.pyu
set_tunnels
		uHTTPConnection.set_tunnelc
Cs|dkr|jd�}|jd�}||kr�yt||dd��}WnVtk
r�||dd�dkr�|j}ntd||dd���YnX|d|�}n	|j}|r|ddkr|ddkr|dd	�}qn||_||_dS(
Nu:u]iuunonnumeric port: '%s'iu[i����i����(uNoneurfinduintu
ValueErrorudefault_portu
InvalidURLuhostuport(uselfuhostuportuiuj((u0/opt/alt/python33/lib64/python3.3/http/client.pyu
_set_hostports 
#	&	uHTTPConnection._set_hostportcCs
||_dS(N(u
debuglevel(uselfulevel((u0/opt/alt/python33/lib64/python3.3/http/client.pyuset_debuglevel1suHTTPConnection.set_debuglevelcCsd|j|j|j�d|j|jf}|jd�}|j|�xI|jj�D]8\}}d||f}|jd�}|j|�qXW|jd�|j	|j
d|j�}|j�\}}	}
|	dkr	|j
�tjd|	|
j�f��nxT|jjtd	�}t|�tkrCtd
��n|sMPn|d
krPqqdS(NuCONNECT %s:%d HTTP/1.0
uasciiu%s: %s
ulatin-1s
umethodi�uTunnel connection failed: %d %siuheader lines
s(s
s
s(u
_set_hostportu_tunnel_hostu_tunnel_portuhostuportuencodeusendu_tunnel_headersuitemsuresponse_classusocku_methodu_read_statusucloseusocketuerrorustripufpureadlineu_MAXLINEulenuLineTooLong(uselfuconnect_stru
connect_bytesuheaderuvalueu
header_struheader_bytesuresponseuversionucodeumessageuline((u0/opt/alt/python33/lib64/python3.3/http/client.pyu_tunnel4s.


uHTTPConnection._tunnelcCsDtj|j|jf|j|j�|_|jr@|j�ndS(u3Connect to the host and port specified in __init__.N(	usocketucreate_connectionuhostuportutimeoutusource_addressusocku_tunnel_hostu_tunnel(uself((u0/opt/alt/python33/lib64/python3.3/http/client.pyuconnectPs	uHTTPConnection.connectcCsQ|jr"|jj�d|_n|jrD|jj�d|_nt|_dS(u(Close the connection to the HTTP server.N(usockucloseuNoneu_HTTPConnection__responseu_CS_IDLEu_HTTPConnection__state(uself((u0/opt/alt/python33/lib64/python3.3/http/client.pyucloseWs	
	
uHTTPConnection.closecCs�|jd	kr1|jr%|j�q1t��n|jdkrVtdt|��nd}t|d�r+|jdkr�td�nd}y
|j
}Wntk
r�Yn2Xd|kr�d}|jdkr�td�q�nxD|j
|�}|s�Pn|r|jd�}n|jj|�q�d	Sy|jj|�Wn^tk
r�t|tj�r�x7|D]}|jj|�qhWntd
t|���YnXd	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 %rFT(usockuNoneu	auto_openuconnectuNotConnectedu
debugleveluprinturepruhasattruFalseumodeuAttributeErroruTrueureaduencodeusendallu	TypeErroru
isinstanceucollectionsuIterableutype(uselfudatau	blocksizeuencodeumodeu	datablockud((u0/opt/alt/python33/lib64/python3.3/http/client.pyusendasF	





uHTTPConnection.sendcCs|jj|�dS(uuAdd a line of output to the current request buffer.

        Assumes that the line does *not* end with \r\n.
        N(u_bufferuappend(uselfus((u0/opt/alt/python33/lib64/python3.3/http/client.pyu_output�suHTTPConnection._outputcCs�|jjd�dj|j�}|jdd�=t|t�rT||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.
        ss
N(ss(u_bufferuextendujoinu
isinstanceubytesuNoneusend(uselfumessage_bodyumsg((u0/opt/alt/python33/lib64/python3.3/http/client.pyu_send_output�s
	
uHTTPConnection._send_outputc
Cs|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�}YnX|jd|�q�y|jj
d�}	Wn$tk
rf|jj
d�}	YnX|jjd	�d
kr�d|	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:is[s]u%s:%suAccept-EncodinguidentityN(u_HTTPConnection__responseuiscloseduNoneu_HTTPConnection__stateu_CS_IDLEu_CS_REQ_STARTEDuCannotSendRequestu_methodu
_http_vsn_stru_outputuencodeu	_http_vsnu
startswithuurlsplituUnicodeEncodeErroru	putheaderuhostufinduportudefault_portudecode(
uselfumethoduurlu	skip_hostuskip_accept_encodingurequestunetlocunilu
netloc_encuhost_enc((u0/opt/alt/python33/lib64/python3.3/http/client.pyu
putrequest�sD		

 
uHTTPConnection.putrequestcGs/|jtkrt��nt|d�r<|jd�}nt|�s^td|f��nt|�}x�t|�D]�\}}t|d�r�|jd�||<n+t	|t
�r�t|�jd�||<nt||�rwtd||f��qwqwWdj
|�}|d|}|j|�dS(	ukSend a request header line to the server.

        For example: h.putheader('Accept', 'text/html')
        uencodeuasciiuInvalid header name %rulatin-1uInvalid header value %rs
	s: N(u_HTTPConnection__stateu_CS_REQ_STARTEDuCannotSendHeaderuhasattruencodeu_is_legal_header_nameu
ValueErrorulistu	enumerateu
isinstanceuintustru_is_illegal_header_valueujoinu_output(uselfuheaderuvaluesuiu	one_valueuvalue((u0/opt/alt/python33/lib64/python3.3/http/client.pyu	putheader!s"uHTTPConnection.putheadercCs5|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(u_HTTPConnection__stateu_CS_REQ_STARTEDu_CS_REQ_SENTuCannotSendHeaderu_send_output(uselfumessage_body((u0/opt/alt/python33/lib64/python3.3/http/client.pyu
endheaders=s		uHTTPConnection.endheaderscCs|j||||�dS(u&Send a complete request to the server.N(u
_send_request(uselfumethoduurlubodyuheaders((u0/opt/alt/python33/lib64/python3.3/http/client.pyurequestLsuHTTPConnection.requestcCs�d}ytt|��}Wn~tk
r�}z^y"ttj|j��j�}Wn4tt	fk
r�|j
dkr�td�nYnXWYdd}~XnX|dk	r�|jd|�ndS(Niu
Cannot stat!!uContent-Length(
uNoneustrulenu	TypeErroruosufstatufilenoust_sizeuAttributeErroruOSErroru
debugleveluprintu	putheader(uselfubodyuthelenute((u0/opt/alt/python33/lib64/python3.3/http/client.pyu_set_content_lengthPs"%u"HTTPConnection._set_content_lengthc	Cs�tjdd�|D��}i}d|kr;d|d<nd|krTd|d<n|j|||�|dk	r�d|kr�|j|�nx*|j�D]\}}|j||�q�Wt|t�r�|j	d	�}n|j
|�dS(
NcSsg|]}|j��qS((ulower(u.0uk((u0/opt/alt/python33/lib64/python3.3/http/client.pyu
<listcomp>cs	u0HTTPConnection._send_request.<locals>.<listcomp>uhostiu	skip_hostuaccept-encodinguskip_accept_encodingucontent-lengthu
iso-8859-1(udictufromkeysu
putrequestuNoneu_set_content_lengthuitemsu	putheaderu
isinstanceustruencodeu
endheaders(	uselfumethoduurlubodyuheadersuheader_namesuskipsuhdruvalue((u0/opt/alt/python33/lib64/python3.3/http/client.pyu
_send_requestas

uHTTPConnection._send_requestcCs�|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.
        iumethodN(u_HTTPConnection__responseuiscloseduNoneu_HTTPConnection__stateu_CS_REQ_SENTuResponseNotReadyu
debugleveluresponse_classusocku_methodubeginu_CS_IDLEu
will_closeuclose(uselfuresponse((u0/opt/alt/python33/lib64/python3.3/http/client.pyugetresponsevs
		
	uHTTPConnection.getresponseN( u__name__u
__module__u__qualname__u	_http_vsnu
_http_vsn_struHTTPResponseuresponse_classu	HTTP_PORTudefault_portu	auto_openu
debugleveluNoneu_strict_sentinelusocketu_GLOBAL_DEFAULT_TIMEOUTu__init__u
set_tunnelu
_set_hostportuset_debuglevelu_tunneluconnectucloseusendu_outputu_send_outputu
putrequestu	putheaderu
endheadersurequestu_set_content_lengthu
_send_requestugetresponse(u
__locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyuHTTPConnection�s0

0tc
s_|EeZdZdZeZdddddddeej	d�fdd�Z
dd�Z�S(	uHTTPSConnectionu(This class allows communication via SSL.ucontextucheck_hostnamecs�tt|�j|||||�||_||_|dkrgtjtj�}|j	tj
O_	n|jtjk}
|	dkr�|
}	n|	r�|
r�t
d��n|s�|r�|j||�n||_|	|_dS(NuMcheck_hostname needs a SSL context with either CERT_OPTIONAL or CERT_REQUIRED(usuperuHTTPSConnectionu__init__ukey_fileu	cert_fileuNoneusslu
SSLContextuPROTOCOL_SSLv23uoptionsuOP_NO_SSLv2uverify_modeu	CERT_NONEu
ValueErroruload_cert_chainu_contextu_check_hostname(uselfuhostuportukey_fileu	cert_fileustrictutimeoutusource_addressucontextucheck_hostnameuwill_verify(u	__class__(u0/opt/alt/python33/lib64/python3.3/http/client.pyu__init__�s 			
	uHTTPSConnection.__init__cCs�tj|j|jf|j|j�}|jrF||_|j�nt	j
rX|jnd}|jj
|d|�|_y,|jr�t	j|jj�|j�nWn5tk
r�|jjtj�|jj��YnXdS(u(Connect to a host on a given (SSL) port.userver_hostnameN(usocketucreate_connectionuhostuportutimeoutusource_addressu_tunnel_hostusocku_tunnelussluHAS_SNIuNoneu_contextuwrap_socketu_check_hostnameumatch_hostnameugetpeercertu	Exceptionushutdownu	SHUT_RDWRuclose(uselfusockuserver_hostname((u0/opt/alt/python33/lib64/python3.3/http/client.pyuconnect�s		
	#

uHTTPSConnection.connectN(u__name__u
__module__u__qualname__u__doc__u
HTTPS_PORTudefault_portuNoneu_strict_sentinelusocketu_GLOBAL_DEFAULT_TIMEOUTu__init__uconnect(u
__locals__((u	__class__u0/opt/alt/python33/lib64/python3.3/http/client.pyuHTTPSConnection�s
0uHTTPSConnectioncBs|EeZdZdS(u
HTTPExceptionN(u__name__u
__module__u__qualname__(u
__locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyu
HTTPException�scBs|EeZdZdS(uNotConnectedN(u__name__u
__module__u__qualname__(u
__locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyuNotConnected�scBs|EeZdZdS(u
InvalidURLN(u__name__u
__module__u__qualname__(u
__locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyu
InvalidURL�scBs |EeZdZdd�ZdS(uUnknownProtocolcCs|f|_||_dS(N(uargsuversion(uselfuversion((u0/opt/alt/python33/lib64/python3.3/http/client.pyu__init__�suUnknownProtocol.__init__N(u__name__u
__module__u__qualname__u__init__(u
__locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyuUnknownProtocol�scBs|EeZdZdS(uUnknownTransferEncodingN(u__name__u
__module__u__qualname__(u
__locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyuUnknownTransferEncoding�scBs|EeZdZdS(uUnimplementedFileModeN(u__name__u
__module__u__qualname__(u
__locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyuUnimplementedFileMode�scBs;|EeZdZddd�Zdd�Zdd�ZdS(uIncompleteReadcCs"|f|_||_||_dS(N(uargsupartialuexpected(uselfupartialuexpected((u0/opt/alt/python33/lib64/python3.3/http/client.pyu__init__�s	uIncompleteRead.__init__cCs<|jdk	rd|j}nd}dt|j�|fS(Nu, %i more expecteduuIncompleteRead(%i bytes read%s)(uexpecteduNoneulenupartial(uselfue((u0/opt/alt/python33/lib64/python3.3/http/client.pyu__repr__suIncompleteRead.__repr__cCs
t|�S(N(urepr(uself((u0/opt/alt/python33/lib64/python3.3/http/client.pyu__str__suIncompleteRead.__str__N(u__name__u
__module__u__qualname__uNoneu__init__u__repr__u__str__(u
__locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyuIncompleteRead�scBs|EeZdZdS(uImproperConnectionStateN(u__name__u
__module__u__qualname__(u
__locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyuImproperConnectionState
scBs|EeZdZdS(uCannotSendRequestN(u__name__u
__module__u__qualname__(u
__locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyuCannotSendRequest
scBs|EeZdZdS(uCannotSendHeaderN(u__name__u
__module__u__qualname__(u
__locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyuCannotSendHeaderscBs|EeZdZdS(uResponseNotReadyN(u__name__u
__module__u__qualname__(u
__locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyuResponseNotReadyscBs |EeZdZdd�ZdS(u
BadStatusLinecCs.|st|�}n|f|_||_dS(N(urepruargsuline(uselfuline((u0/opt/alt/python33/lib64/python3.3/http/client.pyu__init__suBadStatusLine.__init__N(u__name__u
__module__u__qualname__u__init__(u
__locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyu
BadStatusLinescBs |EeZdZdd�ZdS(uLineTooLongcCstj|dt|f�dS(Nu&got more than %d bytes when reading %s(u
HTTPExceptionu__init__u_MAXLINE(uselfu	line_type((u0/opt/alt/python33/lib64/python3.3/http/client.pyu__init__suLineTooLong.__init__N(u__name__u
__module__u__qualname__u__init__(u
__locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyuLineTooLongsuLineTooLong(mu__doc__uemail.parseruemailu
email.messageuiouosureusocketucollectionsuurllib.parseuurlsplituwarningsu__all__u	HTTP_PORTu
HTTPS_PORTu_UNKNOWNu_CS_IDLEu_CS_REQ_STARTEDu_CS_REQ_SENTuCONTINUEuSWITCHING_PROTOCOLSu
PROCESSINGuOKuCREATEDuACCEPTEDuNON_AUTHORITATIVE_INFORMATIONu
NO_CONTENTu
RESET_CONTENTuPARTIAL_CONTENTuMULTI_STATUSuIM_USEDuMULTIPLE_CHOICESuMOVED_PERMANENTLYuFOUNDu	SEE_OTHERuNOT_MODIFIEDu	USE_PROXYuTEMPORARY_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_FAILEDuUNPROCESSABLE_ENTITYuLOCKEDuFAILED_DEPENDENCYuUPGRADE_REQUIREDuPRECONDITION_REQUIREDuTOO_MANY_REQUESTSuREQUEST_HEADER_FIELDS_TOO_LARGEuINTERNAL_SERVER_ERRORuNOT_IMPLEMENTEDuBAD_GATEWAYuSERVICE_UNAVAILABLEuGATEWAY_TIMEOUTuHTTP_VERSION_NOT_SUPPORTEDuINSUFFICIENT_STORAGEuNOT_EXTENDEDuNETWORK_AUTHENTICATION_REQUIREDu	responsesu	MAXAMOUNTu_MAXLINEu_MAXHEADERSucompileumatchu_is_legal_header_nameusearchu_is_illegal_header_valueumessageuMessageuHTTPMessageu
parse_headersuobjectu_strict_sentinelu	RawIOBaseuHTTPResponseuHTTPConnectionussluImportErroruHTTPSConnectionuappendu	Exceptionu
HTTPExceptionuNotConnectedu
InvalidURLuUnknownProtocoluUnknownTransferEncodinguUnimplementedFileModeuIncompleteReaduImproperConnectionStateuCannotSendRequestuCannotSendHeaderuResponseNotReadyu
BadStatusLineuLineTooLonguerror(((u0/opt/alt/python33/lib64/python3.3/http/client.pyu<module>Cs0			
	����
2