AlkantarClanX12

Your IP : 3.149.250.65


Current Path : /usr/lib64/python3.6/asyncio/__pycache__/
Upload File :
Current File : //usr/lib64/python3.6/asyncio/__pycache__/base_subprocess.cpython-36.opt-2.pyc

3


 \�#�@s�ddlZddlZddlZddlmZddlmZddlmZddlmZddl	m
Z
Gdd	�d	ej�ZGd
d�dej
�ZGdd
�d
eej�ZdS)�N�)�compat)�	protocols)�
transports)�	coroutine)�loggercs�eZdZd0�fdd�	Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	e
jrTdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zed d!��Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zed*d+��Zd,d-�Zd.d/�Z�ZS)1�BaseSubprocessTransportNc
s&t�j|
�d|_||_||_d|_d|_d|_g|_t	j
�|_i|_d|_
|tjkr`d|jd<|tjkrtd|jd<|tjkr�d|jd<y"|jf||||||d�|��Wn|j��YnX|jj|_|j|jd<|jj��rt|ttf�r�|}n|d}tjd||j�|jj|j|	��dS)NFrr�)�args�shell�stdin�stdout�stderr�bufsize�
subprocesszprocess %r created: pid %s)�super�__init__�_closed�	_protocol�_loop�_proc�_pid�_returncode�
_exit_waiters�collections�deque�_pending_calls�_pipes�	_finishedr�PIPE�_start�close�pidZ_extra�	get_debug�
isinstance�bytes�strr�debugZcreate_task�_connect_pipes)
�self�loop�protocolr
rrr
rr�waiterZextra�kwargsZprogram)�	__class__��//usr/lib64/python3.6/asyncio/base_subprocess.pyrs@








z BaseSubprocessTransport.__init__cCs|jjg}|jr|jd�|jdk	r4|jd|j�|jdk	rP|jd|j�n |jdk	rf|jd�n
|jd�|jjd�}|dk	r�|jd|j�|jjd�}|jjd	�}|dk	r�||kr�|jd
|j�n0|dk	r�|jd|j�|dk	r�|jd|j�d
dj	|�S)N�closedzpid=%sz
returncode=%sZrunningznot startedrzstdin=%srr	zstdout=stderr=%sz	stdout=%sz	stderr=%sz<%s>� )
r.�__name__r�appendrrr�get�pipe�join)r)�inforr
rr/r/r0�__repr__9s,





z BaseSubprocessTransport.__repr__cKst�dS)N)�NotImplementedError)r)r
rrr
rrr-r/r/r0r VszBaseSubprocessTransport._startcCs
||_dS)N)r)r)r+r/r/r0�set_protocolYsz$BaseSubprocessTransport.set_protocolcCs|jS)N)r)r)r/r/r0�get_protocol\sz$BaseSubprocessTransport.get_protocolcCs|jS)N)r)r)r/r/r0�
is_closing_sz"BaseSubprocessTransport.is_closingcCs�|jr
dSd|_x&|jj�D]}|dkr*q|jj�qW|jdk	r�|jdkr�|jj�dkr�|jj	�rpt
jd|�y|jj�Wnt
k
r�YnXdS)NTz$Close running child process: kill %r)rr�valuesr6r!rrZpollrr#rZwarning�kill�ProcessLookupError)r)�protor/r/r0r!bs 


zBaseSubprocessTransport.closecCs&|js"tjd|t|d�|j�dS)Nzunclosed transport %r)�source)r�warnings�warn�ResourceWarningr!)r)r/r/r0�__del__�szBaseSubprocessTransport.__del__cCs|jS)N)r)r)r/r/r0�get_pid�szBaseSubprocessTransport.get_pidcCs|jS)N)r)r)r/r/r0�get_returncode�sz&BaseSubprocessTransport.get_returncodecCs||jkr|j|jSdSdS)N)rr6)r)�fdr/r/r0�get_pipe_transport�s
z*BaseSubprocessTransport.get_pipe_transportcCs|jdkrt��dS)N)rr@)r)r/r/r0�_check_proc�s
z#BaseSubprocessTransport._check_proccCs|j�|jj|�dS)N)rKr�send_signal)r)�signalr/r/r0rL�sz#BaseSubprocessTransport.send_signalcCs|j�|jj�dS)N)rKr�	terminate)r)r/r/r0rN�sz!BaseSubprocessTransport.terminatecCs|j�|jj�dS)N)rKrr?)r)r/r/r0r?�szBaseSubprocessTransport.killc	#sPy�j}�j}|jdk	rB|j�fdd�|j�EdH\}}|�jd<|jdk	rv|j�fdd�|j�EdH\}}|�jd<|jdk	r�|j�fdd�|j�EdH\}}|�jd<|j�j	j
��x"�jD]\}}|j|f|��q�Wd�_WnDtk
�r*}z&|dk	�r|j
��r|j|�WYdd}~Xn"X|dk	�rL|j
��rL|jd�dS)Ncs
t�d�S)Nr)�WriteSubprocessPipeProtor/)r)r/r0�<lambda>�sz8BaseSubprocessTransport._connect_pipes.<locals>.<lambda>rcs
t�d�S)Nr)�ReadSubprocessPipeProtor/)r)r/r0rP�srcs
t�d�S)Nr	)rQr/)r)r/r0rP�sr	)rrrZconnect_write_piperr
Zconnect_read_piper�	call_soonr�connection_mader�	Exception�	cancelledZ
set_exception�
set_result)	r)r,�procr*�_r6�callback�data�excr/)r)r0r(�s6









z&BaseSubprocessTransport._connect_pipescGs2|jdk	r|jj||f�n|jj|f|��dS)N)rr4rrR)r)�cbrZr/r/r0�_call�s
zBaseSubprocessTransport._callcCs|j|jj||�|j�dS)N)r]rZpipe_connection_lost�_try_finish)r)rIr[r/r/r0�_pipe_connection_lost�sz-BaseSubprocessTransport._pipe_connection_lostcCs|j|jj||�dS)N)r]rZpipe_data_received)r)rIrZr/r/r0�_pipe_data_received�sz+BaseSubprocessTransport._pipe_data_receivedcCst|jj�rtjd||�||_|jjdkr2||j_|j|jj	�|j
�x |jD]}|j�sP|j
|�qPWd|_dS)Nz%r exited with return code %r)rr#rr8rr�
returncoder]rZprocess_exitedr^rrUrV)r)rar,r/r/r0�_process_exited�s
z'BaseSubprocessTransport._process_exitedccs0|jdk	r|jS|jj�}|jj|�|EdHS)N)rrZ
create_futurerr4)r)r,r/r/r0�_wait�s


zBaseSubprocessTransport._waitcCs>|jdkrdStdd�|jj�D��r:d|_|j|jd�dS)Ncss|]}|dk	o|jVqdS)N)�disconnected)�.0�pr/r/r0�	<genexpr>�sz6BaseSubprocessTransport._try_finish.<locals>.<genexpr>T)r�allrr>rr]�_call_connection_lost)r)r/r/r0r^�s
z#BaseSubprocessTransport._try_finishcCs*z|jj|�Wdd|_d|_d|_XdS)N)r�connection_lostrr)r)r[r/r/r0ri�s
z-BaseSubprocessTransport._call_connection_lost)NN)r3�
__module__�__qualname__rr9r r;r<r=r!rZPY34rFrGrHrJrKrLrNr?rr(r]r_r`rbrcr^ri�
__classcell__r/r/)r.r0rs0)%	rc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)rOcCs||_||_d|_d|_dS)NF)rWrIr6rd)r)rWrIr/r/r0rsz!WriteSubprocessPipeProto.__init__cCs
||_dS)N)r6)r)Z	transportr/r/r0rSsz(WriteSubprocessPipeProto.connection_madecCsd|jj|j|jfS)Nz<%s fd=%s pipe=%r>)r.r3rIr6)r)r/r/r0r9sz!WriteSubprocessPipeProto.__repr__cCs d|_|jj|j|�d|_dS)NT)rdrWr_rI)r)r[r/r/r0rjsz(WriteSubprocessPipeProto.connection_lostcCs|jjj�dS)N)rWr�
pause_writing)r)r/r/r0rnsz&WriteSubprocessPipeProto.pause_writingcCs|jjj�dS)N)rWr�resume_writing)r)r/r/r0rosz'WriteSubprocessPipeProto.resume_writingN)	r3rkrlrrSr9rjrnror/r/r/r0rOsrOc@seZdZdd�ZdS)rQcCs|jj|j|�dS)N)rWr`rI)r)rZr/r/r0�
data_received$sz%ReadSubprocessPipeProto.data_receivedN)r3rkrlrpr/r/r/r0rQ!srQ)rrrC�rrrZ
coroutinesr�logrZSubprocessTransportrZBaseProtocolrOZProtocolrQr/r/r/r0�<module>s{