Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/twisted/trial/_dist/__pycache__/workertrial.cpython-39.pyc
Ðазад
a k�hz � @ s� d Z ddlZddlZddlZddlmZ ddlmZmZ ddl m Z mZ ddlm Z G dd� d�Zejfd d �Zedkr~e� dS )zj Implementation of C{AMP} worker commands, and main executable entry point for the workers. @since: 12.3 � N)�FileWrapper)�startLoggingWithObserver�textFromEventDict)�_WORKER_AMP_STDIN�_WORKER_AMP_STDOUT)� WorkerOptionsc @ s e Zd ZdZdd� Zdd� ZdS )�WorkerLogObserverzF A log observer that forward its output to a C{AMP} protocol. c C s || _ dS )zg @param protocol: a connected C{AMP} protocol instance. @type protocol: C{AMP} N)�protocol)�selfr � r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/twisted/trial/_dist/workertrial.py�__init__ s zWorkerLogObserver.__init__c C s6 ddl m} t|�}|du r dS | jj|j|d� dS )z' Produce a log output. r )�managercommandsN)�out)�twisted.trial._distr r r Z callRemoteZ TestWrite)r Z eventDictr �textr r r �emit# s zWorkerLogObserver.emitN)�__name__� __module__�__qualname__�__doc__r r r r r r r s r c C s t � }|�� ddlm} ||d �}| td�}| td�}|�t|�� t|�}t |j d� z|�d�}W nD ty� } z,|j d tjkr�W Y d}~q\n� W Y d}~n d}~0 0 |d kr�q�q\|�|� |�� tj�� tj�� q\|j�rt�d� |j�� } | jd d|�� jd� dS )z� Main function to be run if __name__ == "__main__". @param _fdopen: If specified, the function to use in place of C{os.fdopen}. @type _fdopen: C{callable} r )�WorkerProtocolzforce-gc�rb�wbF� N� T)Zshow_missing�summary�coverdir)r ZparseOptionsZtwisted.trial._dist.workerr r r ZmakeConnectionr r r r �read�OSError�args�errnoZEINTRZdataReceived�flush�sys�stdout�stderrZtracer�settrace�resultsZ write_resultsr �path) Z_fdopen�configr ZworkerProtocolZ protocolInZprotocolOutZobserver�r�er'