-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/mercurial/httpclient/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/mercurial/httpclient/_readers.pyc

ó
Ì\,Tc@sÎdZddlZddlZejeƒZdefd„ƒYZdejfd„ƒYZ	de
fd„ƒYZd	efd
„ƒYZdefd„ƒYZ
d
efd„ƒYZdefd„ƒ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__(((sA/usr/lib/python2.7/dist-packages/mercurial/httpclient/_readers.pyR)stHTTPRemoteClosedErrorcBseZdZRS(s@The server closed the remote socket in the middle of a response.(RRR(((sA/usr/lib/python2.7/dist-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((sA/usr/lib/python2.7/dist-packages/mercurial/httpclient/_readers.pyt__init__8s		cCs)|jj|ƒ|jt|ƒ7_dS(N(RtappendR	tlen(R
tdata((sA/usr/lib/python2.7/dist-packages/mercurial/httpclient/_readers.pyt	_addchunk=scCs,|jjd|ƒ|jt|ƒ7_dS(Ni(RtinsertR	R
(R
R((sA/usr/lib/python2.7/dist-packages/mercurial/httpclient/_readers.pyt
_pushchunkAscCs+|jjdƒ}|jt|ƒ8_|S(Ni(RtpopR	R
(R
tb((sA/usr/lib/python2.7/dist-packages/mercurial/httpclient/_readers.pyt	_popchunkEscCs|jS(s3Returns true if the response body is entirely read.(R(R
((sA/usr/lib/python2.7/dist-packages/mercurial/httpclient/_readers.pytdoneKscCsö|j|kr%|jr%tƒ‚ng}|}x||jr¯|jƒ}t|ƒ|kr|| }|j||ƒ|}n|j|ƒ|t|ƒ8}|dkr4Pq4q4Wdj|ƒ}t|ƒ|ksò|jrìt|ƒ|ksòt	‚|S(s&Read amt bytes from the response body.it(
R	RRRRR
RRtjointAssertionError(R
tamttblockstneedRtnbtresult((sA/usr/lib/python2.7/dist-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((sA/usr/lib/python2.7/dist-packages/mercurial/httpclient/_readers.pytreadtods	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((sA/usr/lib/python2.7/dist-packages/mercurial/httpclient/_readers.pyt_load{scCs|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
((sA/usr/lib/python2.7/dist-packages/mercurial/httpclient/_readers.pyt_close…s
	N(
RRRRRRRRRRR#R%R&(((sA/usr/lib/python2.7/dist-packages/mercurial/httpclient/_readers.pyR1s							
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((sA/usr/lib/python2.7/dist-packages/mercurial/httpclient/_readers.pyR%šs
	(RRRR%(((sA/usr/lib/python2.7/dist-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
((sA/usr/lib/python2.7/dist-packages/mercurial/httpclient/_readers.pyR&§s
(RRRR*R&(((sA/usr/lib/python2.7/dist-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(R'Rt_amountR-Rt_amount_seen(R
tamount((sA/usr/lib/python2.7/dist-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((sA/usr/lib/python2.7/dist-packages/mercurial/httpclient/_readers.pyR%·s
	(RRRR*RR%(((sA/usr/lib/python2.7/dist-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((sA/usr/lib/python2.7/dist-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((sA/usr/lib/python2.7/dist-packages/mercurial/httpclient/_readers.pyR%Çs:	
				#			
(RRRRR%(((sA/usr/lib/python2.7/dist-packages/mercurial/httpclient/_readers.pyR2¿s	(Rthttplibtloggingt	getLoggerRR(t	ExceptionRt
HTTPExceptionRtobjectRR'R+R.R2(((sA/usr/lib/python2.7/dist-packages/mercurial/httpclient/_readers.pyt<module>!sc	

Copyright © 2017 || Recoded By Mr.Bumblebee