HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3/dist-packages/twisted/trial/_dist/__pycache__/workertrial.cpython-38.pyc
U


W[+�@s�dZddlZddlZddlZdd�Zeej�ddlmZddlm	Z	m
Z
ddlmZddl
mZmZGd	d
�d
e�Zejfdd�Zed
kr�e�dS)zj
Implementation of C{AMP} worker commands, and main executable entry point for
the workers.

@since: 12.3
�NcCs&d|kr"|d�tj�tjdd�<dS)z�
    Override C{sys.path} with what the parent passed in B{TRIAL_PYTHONPATH}.

    @see: twisted.trial._dist.disttrial.DistTrialRunner.launchWorkerProcesses
    ZTRIAL_PYTHONPATHN)�split�os�pathsep�sys�path)�environ�r�A/usr/lib/python3/dist-packages/twisted/trial/_dist/workertrial.py�
_setupPathsr
)�FileWrapper)�startLoggingWithObserver�textFromEventDict)�
WorkerOptions)�_WORKER_AMP_STDIN�_WORKER_AMP_STDOUTc@s eZdZdZdd�Zdd�ZdS)�WorkerLogObserverzF
    A log observer that forward its output to a C{AMP} protocol.
    cCs
||_dS)zg
        @param protocol: a connected C{AMP} protocol instance.
        @type protocol: C{AMP}
        N)�protocol)�selfrrrr	�__init__,szWorkerLogObserver.__init__cCs6ddlm}t|�}|dkr dS|jj|j|d�dS)z'
        Produce a log output.
        r)�managercommandsN)�out)�twisted.trial._distrr
rZ
callRemoteZ	TestWrite)rZ	eventDictr�textrrr	�emit4s
zWorkerLogObserver.emitN)�__name__�
__module__�__qualname__�__doc__rrrrrr	r'src

Cs&t�}|��ddlm}||d�}|td�}|td�}|�t|��t|�}t	|j
d�z|�d�}WnPtk
r�}z2|j
dtjkr�tjdkr�t��WY�
q\n�W5d	}~XYnX|d
kr�q�q\|�|�|��tj��tj��q\|j�r"t�d	�|j��}	|	jdd|��jd�d	S)
z�
    Main function to be run if __name__ == "__main__".

    @param _fdopen: If specified, the function to use in place of C{os.fdopen}.
    @param _fdopen: C{callable}
    r)�WorkerProtocolzforce-gc�rb�wbF�)�rN�T)Zshow_missingZsummary�coverdir)rZparseOptionsZtwisted.trial._dist.workerrrrZmakeConnectionrrrr�read�IOError�args�errnoZEINTRr�version_infoZ	exc_clearZdataReceived�flush�stdout�stderrZtracer�settrace�resultsZ
write_resultsr$r)
Z_fdopenZconfigrZworkerProtocolZ
protocolInZprotocolOutZobserver�r�er.rrr	�main@s:







�r1�__main__)rrrr(r
rZtwisted.internet.protocolrZtwisted.python.logrr
Ztwisted.trial._dist.optionsrrrr�objectr�fdopenr1rrrrr	�<module>s

.