HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //proc/self/root/usr/lib/python2.7/asynchat.pyc
ó
’,bc@sÊdZddlZddlZddlZddlmZddlmZddlm	Z	m
Z
ejejej
ejfZdejfd„ƒYZdd
d	„ƒYZd
dd„ƒYZd„ZdS(s¥A class supporting chat-style (command/response) protocols.

This class adds support for 'chat' style protocols - where one side
sends a 'command', and the other sends a response (examples would be
the common internet protocols - smtp, nntp, ftp, etc..).

The handle_read() method looks at the input stream for the current
'terminator' (usually '\r\n' for single-line responses, '\r\n.\r\n'
for multi-line output), calling self.found_terminator() on its
receipt.

for example:
Say you build an async nntp client using this class.  At the start
of the connection, you'll have self.terminator set to '\r\n', in
order to process the single-line greeting.  Just before issuing a
'LIST' command you'll set it to '\r\n.\r\n'.  The output of the LIST
command will be accumulated (using your own 'collect_incoming_data'
method) up to the terminator, and then control will be returned to
you - by calling your self.found_terminator() method.
iÿÿÿÿN(tdeque(tpy3kwarning(tfilterwarningstcatch_warningst
async_chatcBs¹eZdZdZdZddd„Zd„Zd„Zd„Z	d„Z
d„Zd„Zd	„Z
d
„Zd„Zd„Zd
„Zd„Zd„Zd„Zd„Zd„ZRS(s‡This is an abstract class.  You must derive from this class, and add
    the two methods collect_incoming_data() and found_terminator()icCs8d|_g|_tƒ|_tjj|||ƒdS(Nt(tac_in_buffertincomingRt
producer_fifotasyncoret
dispatchert__init__(tselftsocktmap((s/usr/lib/python2.7/asynchat.pyREs		cCstdƒ‚dS(Nsmust be implemented in subclass(tNotImplementedError(Rtdata((s/usr/lib/python2.7/asynchat.pytcollect_incoming_dataVscCs|jj|ƒdS(N(Rtappend(RR((s/usr/lib/python2.7/asynchat.pyt_collect_incoming_dataYscCsdj|jƒ}|j2|S(NR(tjoinR(Rtd((s/usr/lib/python2.7/asynchat.pyt	_get_data\scCstdƒ‚dS(Nsmust be implemented in subclass(R(R((s/usr/lib/python2.7/asynchat.pytfound_terminatorascCs
||_dS(sRSet the input delimiter.  Can be a fixed string of any length, an integer, or NoneN(t
terminator(Rtterm((s/usr/lib/python2.7/asynchat.pytset_terminatordscCs|jS(N(R(R((s/usr/lib/python2.7/asynchat.pytget_terminatorhscCs y|j|jƒ}Wn8tjk
rP}|jdtkrBdS|jƒdSX|j||_x¸|jrt|jƒ}|j	ƒ}|sª|j
|jƒd|_qdt|tƒsÈt|t
ƒr@|}||kr|j
|jƒd|_|j||_q|j
|j| ƒ|j||_d|_|jƒqdt|ƒ}|jj|ƒ}|dkr®|dkr|j
|j| ƒn|j|||_|jƒqdt|j|ƒ}|rÿ||krû|j
|j| ƒ|j||_nPqd|j
|jƒd|_qdWdS(NiRiÿÿÿÿ(trecvtac_in_buffer_sizetsocketterrortargst_BLOCKING_IO_ERRORSthandle_errorRtlenRRt
isinstancetinttlongRRtfindtfind_prefix_at_end(RRtwhytlbRtntterminator_lentindex((s/usr/lib/python2.7/asynchat.pythandle_readpsN
		
	
cCs|jƒdS(N(t
initiate_send(R((s/usr/lib/python2.7/asynchat.pythandle_write´scCs|jƒdS(N(tclose(R((s/usr/lib/python2.7/asynchat.pythandle_close·scCsz|j}t|ƒ|kr\xNtdt|ƒ|ƒD]!}|jj||||!ƒq4Wn|jj|ƒ|jƒdS(Ni(tac_out_buffer_sizeR#txrangeRRR/(RRtsabsti((s/usr/lib/python2.7/asynchat.pytpushºs	"cCs|jj|ƒ|jƒdS(N(RRR/(Rtproducer((s/usr/lib/python2.7/asynchat.pytpush_with_producerÃscCsdS(s4predicate for inclusion in the readable for select()i((R((s/usr/lib/python2.7/asynchat.pytreadableÇscCs|jp|jS(s4predicate for inclusion in the writable for select()(Rt	connected(R((s/usr/lib/python2.7/asynchat.pytwritableÏscCs|jjdƒdS(sAautomatically close this channel once the outgoing queue is emptyN(RRtNone(R((s/usr/lib/python2.7/asynchat.pytclose_when_doneÓscCsfx_|jra|jra|jd}|sO|jd=|dkrO|jƒdSn|j}y?tƒ0tr~tddtƒnt	|d|ƒ}WdQXWnCt
k
rÜ|jƒ}|rÌ|jj|ƒq|jd=qnXy|j
|ƒ}Wntjk
r|jƒdSX|r]|t|ƒks<|t|ƒkrP|||jd<q]|jd=ndSWdS(Nitignores.*buffer(RR;R=R2R3RRRtDeprecationWarningtbuffert	TypeErrortmoret
appendlefttsendRRR"R#(RtfirsttobsRtnum_sent((s/usr/lib/python2.7/asynchat.pyR/×s:


	



$
cCs!d|_|j2|jjƒdS(NR(RRRtclear(R((s/usr/lib/python2.7/asynchat.pytdiscard_buffersÿs	N(t__name__t
__module__t__doc__RR3R=RRRRRRRR.R0R2R7R9R:R<R>R/RJ(((s/usr/lib/python2.7/asynchat.pyR<s(							D									(tsimple_producercBseZdd„Zd„ZRS(icCs||_||_dS(N(Rtbuffer_size(RRRO((s/usr/lib/python2.7/asynchat.pyRs	cCsYt|jƒ|jkr?|j|j }|j|j|_|S|j}d|_|SdS(NR(R#RRO(Rtresult((s/usr/lib/python2.7/asynchat.pyRCs		(RKRLRRC(((s/usr/lib/python2.7/asynchat.pyRNstfifocBsAeZdd„Zd„Zd„Zd„Zd„Zd„ZRS(cCs(|stƒ|_nt|ƒ|_dS(N(Rtlist(RRR((s/usr/lib/python2.7/asynchat.pyRscCs
t|jƒS(N(R#RR(R((s/usr/lib/python2.7/asynchat.pyt__len__scCs|jS(N(RR(R((s/usr/lib/python2.7/asynchat.pytis_emptyscCs|jdS(Ni(RR(R((s/usr/lib/python2.7/asynchat.pyRF"scCs|jj|ƒdS(N(RRR(RR((s/usr/lib/python2.7/asynchat.pyR7%scCs$|jrd|jjƒfSdSdS(Nii(iN(RRtpopleftR=(R((s/usr/lib/python2.7/asynchat.pytpop(s	N(	RKRLR=RRSRTRFR7RV(((s/usr/lib/python2.7/asynchat.pyRQs				cCs?t|ƒd}x(|r:|j|| ƒr:|d8}qW|S(Ni(R#tendswith(thaystacktneedletl((s/usr/lib/python2.7/asynchat.pyR(=s(((RMR	terrnoRtcollectionsRtsysRtwarningsRRtEAGAINtEALREADYtEINPROGRESStEWOULDBLOCKR!R
RRNRQR((((s/usr/lib/python2.7/asynchat.pyt<module>/sÉ(