MMCT TEAM
Server IP : 111.118.215.189  /  Your IP : 216.73.216.126
Web Server : Apache
System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : a1673wkz ( 2475)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/lib64/python2.7/site-packages/mercurial/httpclient/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //usr/lib64/python2.7/site-packages/mercurial/httpclient/_readers.pyc
�
Hq�Qc@s�dZddlZddlZddlZeje�Zdefd��YZdej	fd��YZ
defd��YZd	efd
��YZ
de
fd��YZd
e
fd��YZdefd��YZdS(s�Reader objects to abstract out different body response types.

This module is package-private. It is not expected that these will
have any clients outside of httpplus.
i����NtReadNotReadycBseZdZRS(s>Raised when read() is attempted but not enough data is loaded.(t__name__t
__module__t__doc__(((sC/usr/lib64/python2.7/site-packages/mercurial/httpclient/_readers.pyR*stHTTPRemoteClosedErrorcBseZdZRS(s@The server closed the remote socket in the middle of a response.(RRR(((sC/usr/lib64/python2.7/site-packages/mercurial/httpclient/_readers.pyR.stAbstractReadercBsbeZdZd�Zd�Zd�Zd�Zd�Zd�Zd
d�Z
d�Zd	�ZRS(s�Abstract base class for response readers.

    Subclasses must implement _load, and should implement _close if
    it's not an error for the server to close their socket without
    some termination condition being detected during _load.
    cCst|_g|_d|_dS(Ni(tFalset	_finishedt_done_chunkstavailable_data(tself((sC/usr/lib64/python2.7/site-packages/mercurial/httpclient/_readers.pyt__init__9s		cCs)|jj|�|jt|�7_dS(N(RtappendR	tlen(R
tdata((sC/usr/lib64/python2.7/site-packages/mercurial/httpclient/_readers.pytaddchunk>scCs,|jjd|�|jt|�7_dS(Ni(RtinsertR	R
(R
R((sC/usr/lib64/python2.7/site-packages/mercurial/httpclient/_readers.pyt	pushchunkBscCs+|jjd�}|jt|�8_|S(Ni(RtpopR	R
(R
tb((sC/usr/lib64/python2.7/site-packages/mercurial/httpclient/_readers.pytpopchunkFscCs|jS(N(R(R
((sC/usr/lib64/python2.7/site-packages/mercurial/httpclient/_readers.pytdoneLscCs�|j|kr%|jr%t��ng}|}x||jr�|j�}t|�|kr|| }|j||�|}n|j|�|t|�8}|dkr4Pq4q4Wdj|�}t|�|ks�|jr�t|�|ks�t	�|S(Nit(
R	RRRRR
RRtjointAssertionError(R
tamttblockstneedRtnbtresult((sC/usr/lib64/python2.7/site-packages/mercurial/httpclient/_readers.pytreadOs"
	
3cCs�|dkrg}nx�|jr�|j�}|j|�t|�}|r�|t|�krr|j||�n|j|| �Pq|j|�qW|S(sdreturn available data chunks up to the first one in which delimstr
        occurs. No data will be returned after delimstr -- the chunk in which
        it occurs will be split and the remainder pushed back onto the available
        data queue. If blocks is supplied chunks will be added to blocks, otherwise
        a new list will be allocated.
        N(tNoneRRtfindR
RR(R
tdelimstrRRti((sC/usr/lib64/python2.7/site-packages/mercurial/httpclient/_readers.pytreadtocs	cCs
t�dS(s5Subclasses must implement this.

        As data is available to be read out of this object, it should
        be placed into the _done_chunks list. Subclasses should not
        rely on data remaining in _done_chunks forever, as it may be
        reaped if the client is parsing data as it comes in.
        N(tNotImplementedError(R
R((sC/usr/lib64/python2.7/site-packages/mercurial/httpclient/_readers.pyt_loadzscCs|jstd��ndS(s�Default implementation of close.

        The default implementation assumes that the reader will mark
        the response as finished on the _finished attribute once the
        entire response body has been read. In the event that this is
        not true, the subclass should override the implementation of
        close (for example, close-is-end responses have to set
        self._finished in the close handler.)
        s5server appears to have closed the socket mid-responseN(RR(R
((sC/usr/lib64/python2.7/site-packages/mercurial/httpclient/_readers.pyt_close�s
	N(
RRRRRRRRRRR#R%R&(((sC/usr/lib64/python2.7/site-packages/mercurial/httpclient/_readers.pyR2s							
tAbstractSimpleReadercBseZdZd�ZRS(s�Abstract base class for simple readers that require no response decoding.

    Examples of such responses are Connection: Close (close-is-end)
    and responses that specify a content length.
    cCsP|r#|js#td|��ntjd|jt|��|j|�dS(Ns*tried to add data (%r) to a closed reader!s%s read an additional %d data(RRtloggertdebugtnameR
R(R
R((sC/usr/lib64/python2.7/site-packages/mercurial/httpclient/_readers.pyR%�s

(RRRR%(((sC/usr/lib64/python2.7/site-packages/mercurial/httpclient/_readers.pyR'�stCloseIsEndReadercBseZdZdZd�ZRS(s?Reader for responses that specify Connection: Close for length.sclose-is-endcCstjd�t|_dS(Ns&Marking close-is-end reader as closed.(R(tinfotTrueR(R
((sC/usr/lib64/python2.7/site-packages/mercurial/httpclient/_readers.pyR&�s
(RRRR*R&(((sC/usr/lib64/python2.7/site-packages/mercurial/httpclient/_readers.pyR+�stContentLengthReadercBs&eZdZdZd�Zd�ZRS(s:Reader for responses that specify an exact content length.scontent-lengthcCs;tj|�||_|dkr.t|_nd|_dS(Ni(RRt_amountR-Rt_amount_seen(R
tamount((sC/usr/lib64/python2.7/site-packages/mercurial/httpclient/_readers.pyR�s

	cCsTtj||�|jt|�7_|j|jkrPt|_tjd�ndS(Nscontent-length read complete(	R'R%R0R
R/R-RR(R)(R
R((sC/usr/lib64/python2.7/site-packages/mercurial/httpclient/_readers.pyR%�s
	(RRRR*RR%(((sC/usr/lib64/python2.7/site-packages/mercurial/httpclient/_readers.pyR.�s	t
ChunkedReadercBs eZdZd�Zd�ZRS(s/Reader for chunked transfer encoding responses.cCs,tj|�||_d|_d|_dS(NiR(RRt_eolt_leftover_skip_amtt_leftover_data(R
teol((sC/usr/lib64/python2.7/site-packages/mercurial/httpclient/_readers.pyR�s
		cCs�|jstd��tjdt|��d}|jrstjd�|j|}|j}d|_d|_nt|�}x||kr�|j|j|�}|dkr�||_||_dSt	|||!dd�}|t|j�}||t|j�t|�kr*||_||_dS|dkrPt
|_tjd	�dS|j||||!�||t|j�}q�WdS(
Ns%tried to add data to a closed reader!s"chunked read an additional %d datais8chunked reader trying to finish block from leftover dataRi����tbaseis/closing chunked reader due to chunk of length 0(RRR(R)R
R5R4R R3tintR-R(R
RtpositiontdatalentsplitRtblock_start((sC/usr/lib64/python2.7/site-packages/mercurial/httpclient/_readers.pyR%�s8	

				#			
(RRRRR%(((sC/usr/lib64/python2.7/site-packages/mercurial/httpclient/_readers.pyR2�s	(Rthttplibt	itertoolstloggingt	getLoggerRR(t	ExceptionRt
HTTPExceptionRtobjectRR'R+R.R2(((sC/usr/lib64/python2.7/site-packages/mercurial/httpclient/_readers.pyt<module>!sa	

MMCT - 2023