File: //lib/python3/dist-packages/twisted/trial/_dist/__pycache__/workertrial.cpython-312.pyc
�
Ϫ�fz � � � d Z ddlZddlZddlZddlmZ ddlmZmZ ddl m
Z
mZ ddlm
Z
G d� d� Zej fd �Zed
k( r e� yy)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 � � e Zd ZdZd� Zd� Zy)�WorkerLogObserverzF
A log observer that forward its output to a C{AMP} protocol.
c � � || _ y)zg
@param protocol: a connected C{AMP} protocol instance.
@type protocol: C{AMP}
N)�protocol)�selfr s �A/usr/lib/python3/dist-packages/twisted/trial/_dist/workertrial.py�__init__zWorkerLogObserver.__init__ s � �
!��
� c �z � ddl m} t |� }|�y| j j |j
|�� y)z'
Produce a log output.
r )�managercommandsN)�out)�twisted.trial._distr r r �
callRemote� TestWrite)r
� eventDictr �texts r �emitzWorkerLogObserver.emit# s6 � � 8� ��+���<���
�
� � ��!:�!:�� �Er N)�__name__�
__module__�__qualname__�__doc__r r � r r r
r
s � ��!� Fr r
c �2 � t � }|j � ddlm} ||d � } | t d� } | t
d� }|j
t |� � t |� }t |j d� |j d� }|d
k( rn^|j! |� |j# � t$ j&