OwlCyberSecurity - MANAGER
Edit File: base_subprocess.cpython-310.opt-1.pyc
o ����S�g�"����������������������@���sx���d�dl�Z�d�dlZd�dlZddlmZ�ddlmZ�ddlmZ�G�dd��dej�Z G�dd ��d ej �ZG�d d��deej�Z dS�)�����N����)� protocols)� transports)�loggerc�����������������������s����e�Zd�Z d0��fdd� Zdd��Zdd��Zdd ��Zd d��Zdd ��Zdd��Z e jfdd�Zdd��Z dd��Zdd��Zdd��Zdd��Zdd��Zdd��Zd d!��Zd"d#��Zd$d%��Zd&d'��Zd(d)��Zd*d+��Zd,d-��Zd.d/��Z���ZS�)1�BaseSubprocessTransportNc����������� ��� ������s��t����| ��d|�_||�_||�_d�|�_d�|�_d�|�_g�|�_t � ��|�_i�|�_d|�_ |tjkr0d�|�jd<�|tjkr:d�|�jd<�|tjkrDd�|�jd<�z|�jd||||||d�|���W�n���|�������|�jj|�_|�j|�jd<�|�j���r�t|ttf�rx|}n|d�}t�d||�j��|�j�|��| ���d�S�) NFr���r�������)�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���r ���r ���r���r���r ����waiterZextra�kwargsZprogram�� __class__r����>/opt/alt/python310/lib64/python3.10/asyncio/base_subprocess.pyr������sH��� � � �z BaseSubprocessTransport.__init__c�����������������C���s��|�j�jg}|�jr |�d��|�jd�ur|�d|�j�����|�jd�ur*|�d|�j�����n|�jd�ur5|�d��n|�d��|�j�d�}|d�urM|�d|j�����|�j�d�}|�j�d �}|d�urk||u�rk|�d |j�����n|d�urx|�d|j�����|d�ur�|�d|j�����d � d� |��S�)N�closedzpid=zreturncode=Zrunningznot startedr���zstdin=r���r���zstdout=stderr=zstdout=zstderr=z<{}>� )r.����__name__r����appendr���r���r����get�pipe�format�join)r(����infor ���r���r���r���r���r/����__repr__7���s,��� z BaseSubprocessTransport.__repr__c�����������������K���s���t���N)�NotImplementedError)r(���r���r ���r ���r���r���r ���r,���r���r���r/���r���T���s���zBaseSubprocessTransport._startc�����������������C���� ���||�_�d�S�r:����r���)r(���r*���r���r���r/����set_protocolW������� z$BaseSubprocessTransport.set_protocolc�����������������C�������|�j�S�r:���r=����r(���r���r���r/����get_protocolZ�������z$BaseSubprocessTransport.get_protocolc�����������������C���r@���r:���)r���rA���r���r���r/���� is_closing]���rC���z"BaseSubprocessTransport.is_closingc�����������������C���s����|�j�rd�S�d|�_�|�j���D�]}|d�u�rq |j����q |�jd�urI|�jd�u�rK|�j���d�u�rM|�j� ��r6t �d|���z|�j����W�d�S��t yH���Y�d�S�w�d�S�d�S�d�S�)NTz$Close running child process: kill %r)r���r����valuesr5���r ���r���r���Zpollr���r"���r���Zwarning�kill�ProcessLookupError)r(����protor���r���r/���r ���`���s(��� ��zBaseSubprocessTransport.closec�����������������C���s*���|�j�s|d|���t|�d��|�����d�S�d�S�)Nzunclosed transport )�source)r����ResourceWarningr ���)r(���Z_warnr���r���r/����__del__{���s����zBaseSubprocessTransport.__del__c�����������������C���r@���r:���)r���rA���r���r���r/����get_pid����rC���zBaseSubprocessTransport.get_pidc�����������������C���r@���r:���)r���rA���r���r���r/����get_returncode����rC���z&BaseSubprocessTransport.get_returncodec�����������������C���s���||�j�v�r|�j�|�jS�d�S�r:���)r���r5���)r(����fdr���r���r/����get_pipe_transport����s��� z*BaseSubprocessTransport.get_pipe_transportc�����������������C���s���|�j�d�u�rt���d�S�r:���)r���rG���rA���r���r���r/����_check_proc����s��� �z#BaseSubprocessTransport._check_procc�����������������C���s���|������|�j�|��d�S�r:���)rP���r����send_signal)r(����signalr���r���r/���rQ�������s���z#BaseSubprocessTransport.send_signalc�����������������C�������|������|�j����d�S�r:���)rP���r���� terminaterA���r���r���r/���rT�����������z!BaseSubprocessTransport.terminatec�����������������C���rS���r:���)rP���r���rF���rA���r���r���r/���rF�������rU���zBaseSubprocessTransport.killc����������� ��� �������s|���zr��j�}��j}|jd�ur"|���fdd�|j�I�d�H�\}}|��jd<�|jd�ur<|���fdd�|j�I�d�H�\}}|��jd<�|jd�urV|���fdd�|j�I�d�H�\}}|��jd<�|���j j ������jD�] \}}|j|g|�R����qad���_W�n7�tt fy}������ty��}�z"|d�ur�|���s�|�|��W�Y�d�}~d�S�W�Y�d�}~d�S�W�Y�d�}~d�S�d�}~ww�|d�ur�|���s�|�d���d�S�d�S�d�S�)Nc����������������������� ���t���d�S�)Nr���)�WriteSubprocessPipeProtor���rA���r���r/����<lambda>�������� �z8BaseSubprocessTransport._connect_pipes.<locals>.<lambda>r���c����������������������rV���)Nr�����ReadSubprocessPipeProtor���rA���r���r/���rX�������rY���r���c����������������������rV���)Nr���rZ���r���rA���r���r/���rX�������rY���r���)r���r���r ���Zconnect_write_piper���r���Zconnect_read_piper���� call_soonr����connection_mader���� SystemExit�KeyboardInterrupt� BaseException� cancelledZ set_exception� set_result) r(���r+����procr)����_r5����callback�data�excr���rA���r/���r'�������sJ���� � � � ����z&BaseSubprocessTransport._connect_pipesc�����������������G���s6���|�j�d�ur|�j��||f��d�S�|�jj|g|�R����d�S�r:���)r���r3���r���r\���)r(����cbrf���r���r���r/����_call����s��� zBaseSubprocessTransport._callc�����������������C���s���|���|�jj||��|�����d�S�r:���)ri���r���Zpipe_connection_lost�_try_finish)r(���rN���rg���r���r���r/����_pipe_connection_lost����s���z-BaseSubprocessTransport._pipe_connection_lostc�����������������C���s���|���|�jj||��d�S�r:���)ri���r���Zpipe_data_received)r(���rN���rf���r���r���r/����_pipe_data_received����s���z+BaseSubprocessTransport._pipe_data_receivedc�����������������C���sp���|�j����rt�d|�|��||�_|�jjd�u�r||�j_|��|�jj ��|�� ���|�jD�]}|���s2|� |��q'd�|�_d�S�)Nz%r exited with return code %r)r���r"���r���r8���r���r���� returncoderi���r���Zprocess_exitedrj���r���ra���rb���)r(���rm���r+���r���r���r/����_process_exited����s��� � z'BaseSubprocessTransport._process_exitedc���������������������s2����|�j�dur |�j�S�|�j���}|�j�|��|I�dH�S�)zdWait until the process exit and return the process return code. This method is a coroutine.N)r���r���Z create_futurer���r3���)r(���r+���r���r���r/����_wait����s���� zBaseSubprocessTransport._waitc�����������������C���sB���|�j�d�u�rd�S�tdd��|�j���D���rd|�_|��|�jd���d�S�d�S�)Nc�����������������s���s�����|�] }|d�uo |j�V��qd�S�r:���)�disconnected)�.0�pr���r���r/���� <genexpr>����s������z6BaseSubprocessTransport._try_finish.<locals>.<genexpr>T)r����allr���rE���r���ri����_call_connection_lostrA���r���r���r/���rj�������s��� ��z#BaseSubprocessTransport._try_finishc�����������������C���s:���z|�j��|��W�d�|�_d�|�_d�|�_�d�S�d�|�_d�|�_d�|�_�w�r:���)r����connection_lostr���r����r(���rg���r���r���r/���ru�������s��� �z-BaseSubprocessTransport._call_connection_lost)NN)r2���� __module__�__qualname__r���r9���r���r>���rB���rD���r ����warnings�warnrK���rL���rM���rO���rP���rQ���rT���rF���r'���ri���rk���rl���rn���ro���rj���ru���� __classcell__r���r���r-���r/���r��� ���s2�����+& r���c�������������������@���s<���e�Zd�Zdd��Zdd��Zdd��Zdd��Zd d ��Zdd��Zd S�)rW���c�����������������C���s���||�_�||�_d�|�_d|�_d�S�)NF)rc���rN���r5���rp���)r(���rc���rN���r���r���r/���r�����s��� z!WriteSubprocessPipeProto.__init__c�����������������C���r<���r:���)r5���)r(���Z transportr���r���r/���r]�����r?���z(WriteSubprocessPipeProto.connection_madec�����������������C���s ���d|�j�j��d|�j��d|�j�d�S�)N�<z fd=z pipe=�>)r.���r2���rN���r5���rA���r���r���r/���r9��� ��s��� z!WriteSubprocessPipeProto.__repr__c�����������������C���s ���d|�_�|�j�|�j|��d�|�_d�S�)NT)rp���rc���rk���rN���rw���r���r���r/���rv��� ��s��� z(WriteSubprocessPipeProto.connection_lostc�����������������C�������|�j�j����d�S�r:���)rc���r���� pause_writingrA���r���r���r/���r����������z&WriteSubprocessPipeProto.pause_writingc�����������������C���r���r:���)rc���r����resume_writingrA���r���r���r/���r������r����z'WriteSubprocessPipeProto.resume_writingN) r2���rx���ry���r���r]���r9���rv���r����r����r���r���r���r/���rW�������s����rW���c�������������������@���s���e�Zd�Zdd��ZdS�)r[���c�����������������C���s���|�j��|�j|��d�S�r:���)rc���rl���rN���)r(���rf���r���r���r/���� data_received��s���z%ReadSubprocessPipeProto.data_receivedN)r2���rx���ry���r����r���r���r���r/���r[�����s����r[���)r���r���rz�����r���r����logr���ZSubprocessTransportr���ZBaseProtocolrW���ZProtocolr[���r���r���r���r/����<module>���s�����v�