File "streams.cpython-35.opt-2.pyc"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/opt/alt/python35/lib64/python3.5/asyncio/__pycache__/streams.cpython-35.opt-2.pyc
File size: 13.93 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit



]^	@sdddddddgZddlZeed	rIejd
dgdd
lmZddlmZddlmZddlmZddlm	Z	ddl
mZd"ZGddde
ZGdddeZe	dddddeddZe	dddddeddZeed	rte	ddddedd
Ze	ddddeddZGdddejZGdddeejZGd ddZGd!ddZdS)#StreamReaderStreamWriterStreamReaderProtocolopen_connectionstart_serverIncompleteReadErrorLimitOverrunErrorNAF_UNIXopen_unix_connectionstart_unix_server)
coroutines)compat)events)	protocols)	coroutine)loggercs"eZdZfddZS)rcs6tjdt||f||_||_dS)Nz-%d bytes read on a total of %r expected bytes)super__init__lenpartialexpected)selfrr)	__class__,/opt/alt/python35/lib64/python3.5/streams.pyr s	zIncompleteReadError.__init__)__name__
__module____qualname__rrr)rrrscs"eZdZfddZS)rcstj|||_dS)N)rrconsumed)rmessager!)rrrr-szLimitOverrunError.__init__)rrr rrr)rrr'slooplimitc	+s|dkrtj}td|d|}t|d||jfdd|||EdH\}}t|||}||fS)Nr$r#csS)Nrr)protocolrr<lambda>Ksz!open_connection.<locals>.<lambda>)rget_event_looprrcreate_connectionr)	hostportr#r$kwdsreader	transport_writerr)r%rr2s)c+sKdkrtjfdd}j||||EdHS)Ncs.tdd}t|d}|S)Nr$r#)rr)r,r%)client_connected_cbr$r#rrfactoryks	zstart_server.<locals>.factory)rr'Z
create_server)r0r)r*r#r$r+r1r)r0r$r#rrPsc+s|dkrtj}td|d|}t|d||jfdd||EdH\}}t|||}||fS)Nr$r#csS)Nrr)r%rrr&sz&open_unix_connection.<locals>.<lambda>)rr'rrZcreate_unix_connectionr)pathr#r$r+r,r-r.r/r)r%rr
ws&c+sHdkrtjfdd}j|||EdHS)Ncs.tdd}t|d}|S)Nr$r#)rr)r,r%)r0r$r#rrr1s	z"start_unix_server.<locals>.factory)rr'Zcreate_unix_server)r0r2r#r$r+r1r)r0r$r#rrsc@sUeZdZdddZddZddZdd	Zed
dZdS)FlowControlMixinNcCsF|dkrtj|_n	||_d|_d|_d|_dS)NF)rr'_loop_paused
_drain_waiter_connection_lost)rr#rrrrs			zFlowControlMixin.__init__cCs,d|_|jjr(tjd|dS)NTz%r pauses writing)r5r4	get_debugrdebug)rrrr
pause_writings	zFlowControlMixin.pause_writingcCscd|_|jjr(tjd||j}|dk	r_d|_|js_|jddS)NFz%r resumes writing)r5r4r8rr9r6done
set_result)rwaiterrrrresume_writings			zFlowControlMixin.resume_writingcCsud|_|jsdS|j}|dkr/dSd|_|jrHdS|dkrd|jdn
|j|dS)NT)r7r5r6r;r<
set_exception)rexcr=rrrconnection_losts				z FlowControlMixin.connection_lostccsP|jrtd|js"dS|j}|jj}||_|EdHdS)NzConnection lost)r7ConnectionResetErrorr5r6r4
create_future)rr=rrr
_drain_helpers				zFlowControlMixin._drain_helper)	rrr rr:r>rArrDrrrrr3s

	r3cs^eZdZddfddZddZfddZdd	Zd
dZS)rNcs;tjd|||_d|_||_d|_dS)Nr#F)rr_stream_reader_stream_writer_client_connected_cb	_over_ssl)rZ
stream_readerr0r#)rrrrs
			zStreamReaderProtocol.__init__cCs|jj||jddk	|_|jdk	rt|||j|j|_|j|j|j}tj	|r|jj
|dS)NZ
sslcontext)rE
set_transportget_extra_inforHrGrr4rFr
ZiscoroutineZcreate_task)rr-resrrrconnection_mades	z$StreamReaderProtocol.connection_madecsa|jdk	r;|dkr+|jjn|jj|tj|d|_d|_dS)N)rEfeed_eofr?rrArF)rr@)rrrrAs	z$StreamReaderProtocol.connection_lostcCs|jj|dS)N)rE	feed_data)rdatarrr
data_receivedsz"StreamReaderProtocol.data_receivedcCs|jj|jrdSdS)NFT)rErMrH)rrrreof_receiveds
	z!StreamReaderProtocol.eof_received)rrr rrLrArPrQrr)rrrs
	
c@seZdZddZddZeddZddZd	d
ZddZ	d
dZ
ddZdddZe
ddZdS)rcCs(||_||_||_||_dS)N)
_transport	_protocol_readerr4)rr-r%r,r#rrrrs			zStreamWriter.__init__cCsM|jjd|jg}|jdk	r<|jd|jddj|S)Nztransport=%rz	reader=%rz<%s> )rrrRrTappendjoin)rinforrr__repr__szStreamWriter.__repr__cCs|jS)N)rR)rrrrr-!szStreamWriter.transportcCs|jj|dS)N)rRwrite)rrOrrrrZ%szStreamWriter.writecCs|jj|dS)N)rR
writelines)rrOrrrr[(szStreamWriter.writelinescCs
|jjS)N)rR	write_eof)rrrrr\+szStreamWriter.write_eofcCs
|jjS)N)rR
can_write_eof)rrrrr].szStreamWriter.can_write_eofcCs
|jjS)N)rRclose)rrrrr^1szStreamWriter.closeNcCs|jj||S)N)rRrJ)rnamedefaultrrrrJ4szStreamWriter.get_extra_infoccsi|jdk	r0|jj}|dk	r0||jdk	rS|jjrSdV|jjEdHdS)N)rT	exceptionrRZ
is_closingrSrD)rr@rrrdrain7s	zStreamWriter.drain)rrr rrYpropertyr-rZr[r\r]r^rJrrbrrrrr	s
c@s0eZdZedddZddZddZdd	Zd
dZdd
Z	ddZ
ddZddZddZ
eddZeddZedddZed'ddZed d!Zejred"d#Zed$d%Zejr,d&d#ZdS)(rNcCs|dkrtd||_|dkr?tj|_n	||_t|_d|_d|_d|_	d|_
d|_dS)NrzLimit cannot be <= 0F)
ValueError_limitrr'r4	bytearray_buffer_eof_waiter
_exceptionrRr5)rr$r#rrrrRs						zStreamReader.__init__cCsdg}|jr,|jdt|j|jrB|jd|jtkre|jd|j|jr|jd|j|jr|jd|j|jr|jd|j|j	r|jdd	d
j
|S)Nrz%d byteseofzl=%dzw=%rze=%rzt=%rZpausedz<%s>rU)rgrVrrhre_DEFAULT_LIMITrirjrRr5rW)rrXrrrrYes 			
				
zStreamReader.__repr__cCs|jS)N)rj)rrrrrawszStreamReader.exceptioncCsD||_|j}|dk	r@d|_|js@|j|dS)N)rjri	cancelledr?)rr@r=rrrr?zs			zStreamReader.set_exceptioncCs;|j}|dk	r7d|_|js7|jddS)N)rirmr<)rr=rrr_wakeup_waiters
		zStreamReader._wakeup_waitercCs
||_dS)N)rR)rr-rrrrIszStreamReader.set_transportcCs;|jr7t|j|jkr7d|_|jjdS)NF)r5rrgrerRresume_reading)rrrr_maybe_resume_transports!	z$StreamReader._maybe_resume_transportcCsd|_|jdS)NT)rhrn)rrrrrMs	zStreamReader.feed_eofcCs|jo|jS)N)rhrg)rrrrat_eofszStreamReader.at_eofcCs|s
dS|jj||j|jdk	r|jrt|jd|jkry|jjWntk
rd|_Yn
Xd|_dS)NrT)	rgextendrnrRr5rreZ
pause_readingNotImplementedError)rrOrrrrNs


zStreamReader.feed_dataccsq|jdk	rtd||jr>d|_|jj|jj|_z|jEdHWdd|_XdS)NzH%s() called while another coroutine is already waiting for incoming dataF)riRuntimeErrorr5rRror4rC)r	func_namerrr_wait_for_datas

		
zStreamReader._wait_for_dataccsd}t|}y|j|EdH}Wntk
rX}z|jSWYdd}~Xntk
r}za|jj||jr|jd|j|=n
|jj|j	t
|jdWYdd}~XnX|S)Ns
r)r	readuntilrrrrg
startswithr!clearrprdargs)rsepseplenlineerrrreadlines

&zStreamReader.readlines
ccsYt|}|dkr$td|jdk	r<|jd}xt|j}|||kr|jj||}|dkrP|d|}||jkrtd||jrt|j}|jj	t
|d|jdEdHqEW||jkrtd||jd||}|jd||=|jt|S)Nrz,Separator should be at least one-byte stringrz2Separator is not found, and chunk exceed the limitrwz2Separator is found, but chunk is longer than limit)
rrdrjrgfindrerrhbytesryrrvrp)rZ	separatorr|offsetbuflenZisepchunkrrrrws:			

zStreamReader.readuntilrccs|jdk	r|j|dkr(dS|dkryg}x/|j|jEdH}|s[P|j|q=Wdj|S|jr|jr|jdEdHt|jd|}|jd|=|j	|S)Nrread)
rjrrerVrWrgrhrvrrp)rnZblocksblockrOrrrrJs$	

zStreamReader.readccs
|dkrtd|jdk	r0|j|dkr@dSx_t|j|kr|jrt|j}|jjt|||jdEdHqCWt|j|krt|j}|jjn)t|jd|}|jd|=|j	|S)Nrz*readexactly size can not be less than zerorreadexactly)
rdrjrrgrhrryrrvrp)rrZ
incompleterOrrrr}s&		

zStreamReader.readexactlycCs|S)Nr)rrrr	__aiter__szStreamReader.__aiter__ccs'|jEdH}|dkr#t|S)Nr)rStopAsyncIteration)rvalrrr	__anext__szStreamReader.__anext__cCs|S)Nr)rrrrrsr)rrr rlrrYrar?rnrIrprMrqrNrrvrrwrrrZPY35rrZPY352rrrrrPs,	 [2*		i)__all__sockethasattrrrr
rrrrlogrrlEOFErrorr	Exceptionrrrr
rZProtocolr3rrrrrrr<module>s@				"B3G