b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 172.67.192.52 | your ip : 10.244.126.0
safemode OFF
 >  / usr / lib64 / python2.6 /
Filename/usr/lib64/python2.6/asynchat.pyo
Size8.53 kb
Permissionrw-r--r--
Ownerapache
Create time23-Dec-2025 17:41
Last modified20-Jun-2019 19:45
Last accessed22-Apr-2026 03:48
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
Ñò
§ÚêLc@s dZddkZddkZddklZddklZddklZl Z dei
fd��YZ dd
d ��YZ d
dd ��YZ
d �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(t py3kwarning(tfilterwarningstcatch_warningst
async_chatcBs¹eZdZdZdZddd�Zd�Zd�Zd�Z d�Z
d�Z d�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�|_tii|||�dS(Nt(t ac_in_buffertincomingRt
producer_fifotasyncoret
dispatchert__init__(tselftsocktmap((s /usr/lib64/python2.6/asynchat.pyR @s   cCstd��dS(Nsmust be implemented in subclass(tNotImplementedError(R tdata((s /usr/lib64/python2.6/asynchat.pytcollect_incoming_dataQscCs|ii|�dS(N(Rtappend(R R((s /usr/lib64/python2.6/asynchat.pyt_collect_incoming_dataTscCsdi|i�}|i2|S(NR(tjoinR(R td((s /usr/lib64/python2.6/asynchat.pyt _get_dataWscCstd��dS(Nsmust be implemented in subclass(R(R ((s /usr/lib64/python2.6/asynchat.pytfound_terminator\scCs
||_dS(sRSet the input delimiter. Can be a fixed string of any length, an integer, or NoneN(t
terminator(R tterm((s /usr/lib64/python2.6/asynchat.pytset_terminator_scCs|iS(N(R(R ((s /usr/lib64/python2.6/asynchat.pytget_terminatorcscCsy|i|i�}Wn#tij
o}|i�dSX|i||_xÉ|io¾t|i�}|i�}|p|i|i�d|_qOt |t
�pt |t �o{|}||jo-|i|i�d|_|i ||_ q|i|i| �|i||_d|_ |i
�qOt|�}|ii|�}|djoG|djo|i|i| �n|i|||_|i
�qOt|i|�}|o<||jo*|i|i| �|i| |_nPqO|i|i�d|_qOWdS(NRiiÿÿÿÿ(trecvtac_in_buffer_sizetsocketterrort handle_errorRtlenRRt
isinstancetinttlongRRtfindtfind_prefix_at_end(R RtwhytlbRtntterminator_lentindex((s /usr/lib64/python2.6/asynchat.pyt handle_readksL

 
 
   


cCs|i�dS(N(t
initiate_send(R ((s /usr/lib64/python2.6/asynchat.pyt handle_write­scCs|i�dS(N(tclose(R ((s /usr/lib64/python2.6/asynchat.pyt handle_close°scCs||i}t|�|joBxOtdt|�|�D]!}|ii||||!�q5Wn|ii|�|i�dS(Ni(tac_out_buffer_sizeR!txrangeRRR-(R Rtsabsti((s /usr/lib64/python2.6/asynchat.pytpush³s #cCs|ii|�|i�dS(N(RRR-(R tproducer((s /usr/lib64/python2.6/asynchat.pytpush_with_producer¼scCsdS(s4predicate for inclusion in the readable for select()i((R ((s /usr/lib64/python2.6/asynchat.pytreadableÀscCs|ip|i S(s4predicate for inclusion in the writable for select()(Rt connected(R ((s /usr/lib64/python2.6/asynchat.pytwritableÈscCs|iid�dS(sAautomatically close this channel once the outgoing queue is emptyN(RRtNone(R ((s /usr/lib64/python2.6/asynchat.pytclose_when_doneÌsc
Cs�x~|ios|ioi|id}|p*|id=|djo|i�dSn|i}yLt�ii�z1tot ddt
�nt |d|�}WdQXWnGt j
o;|i
�}|o|ii|�q|id=qnXy|i|�}Wn!tij
o|i�dSX|oI|t|�jp|t|�jo|||id<q{|id=ndSWdS(Nitignores.*buffer(RR9R;R0R1Rt__exit__t __enter__RRtDeprecationWarningtbuffert TypeErrortmoret
appendlefttsendRRR R!(R tfirsttobsRtnum_sent((s /usr/lib64/python2.6/asynchat.pyR-Ðs<



   

&cCs!d|_|i2|ii�dS(NR(RRRtclear(R ((s /usr/lib64/python2.6/asynchat.pytdiscard_buffersøs N(t__name__t
__module__t__doc__RR1R;R RRRRRRR,R.R0R5R7R8R:R<R-RJ(((s /usr/lib64/python2.6/asynchat.pyR7s(       B       (tsimple_producercBseZdd�Zd�ZRS(icCs||_||_dS(N(Rt buffer_size(R RRO((s /usr/lib64/python2.6/asynchat.pyR s cCs[t|i�|ijo(|i|i }|i|i|_|S|i}d|_|SdS(NR(R!RRO(R tresult((s /usr/lib64/python2.6/asynchat.pyRCs  (RKRLR RC(((s /usr/lib64/python2.6/asynchat.pyRNþs tfifocBsAeZdd�Zd�Zd�Zd�Zd�Zd�ZRS(cCs*|pt�|_nt|�|_dS(N(Rtlist(R RR((s /usr/lib64/python2.6/asynchat.pyR scCs
t|i�S(N(R!RR(R ((s /usr/lib64/python2.6/asynchat.pyt__len__scCs|i S(N(RR(R ((s /usr/lib64/python2.6/asynchat.pytis_emptyscCs |idS(Ni(RR(R ((s /usr/lib64/python2.6/asynchat.pyRFscCs|ii|�dS(N(RRR(R R((s /usr/lib64/python2.6/asynchat.pyR5scCs&|iod|ii�fSdSdS(Nii(iN(RRtpopleftR;(R ((s /usr/lib64/python2.6/asynchat.pytpop!s
N( RKRLR;R RSRTRFR5RV(((s /usr/lib64/python2.6/asynchat.pyRQs      cCsBt|�d}x+|o#|i|| � o|d8}qW|S(Ni(R!tendswith(thaystacktneedletl((s /usr/lib64/python2.6/asynchat.pyR&6s
(((RMRR t collectionsRtsysRtwarningsRRR
RRNRQR&(((s /usr/lib64/python2.6/asynchat.pyt<module>/s  Ç(