%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/test/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/test/__pycache__/stdio_test_halfclose.cpython-312.pyc

�

Ϫ�f�����dZddlZddlmZddlmZmZddlmZddl	m
Z
mZee�Gd�dej��Z
ed	k(r�ejej d
�j#�e
j$eej dd��dd
lmZe
�Zej,e�ej.�ej0ej2�yy)z�
Main program for the child process run by
L{twisted.test.test_stdio.StandardInputOutputTests.test_readConnectionLost}
to test that IHalfCloseableProtocol.readConnectionLost works for process
transports.
�N)�implementer)�protocol�stdio)�IHalfCloseableProtocol)�log�reflectc�,�eZdZdZdZd�Zd�Zd�Zd�Zy)�HalfCloseProtocolz�
    A protocol to hook up to stdio and observe its transport being
    half-closed.  If all goes as expected, C{exitCode} will be set to C{0};
    otherwise it will be set to C{1} to indicate failure.
    Nc�:�|jjd�y)z=
        Signal the parent process that we're ready.
        �xN)�	transport�write��selfs �C/usr/lib/python3/dist-packages/twisted/test/stdio_test_halfclose.py�connectionMadez HalfCloseProtocol.connectionMade s��	
�����T�"�c�:�d|_tj�y)zv
        This is the desired event.  Once it has happened, stop the reactor so
        the process will exit.
        rN)�exitCode�reactor�stoprs r�readConnectionLostz$HalfCloseProtocol.readConnectionLost&s��
��
����rc�~�|j�d|_tj|d�tj�y)z�
        This may only be invoked after C{readConnectionLost}.  If it happens
        otherwise, mark it as an error and shut down.
        N�z!Unexpected call to connectionLost)rr�errrr)r�reasons  r�connectionLostz HalfCloseProtocol.connectionLost.s-��
�=�=� ��D�M��G�G�F�?�@����rc��y)N�rs r�writeConnectionLostz%HalfCloseProtocol.writeConnectionLost8s��r)	�__name__�
__module__�__qualname__�__doc__rrrrr rrrr
r
s"����H�#���
rr
�__main__r��wb)r)r$�sys�zope.interfacer�twisted.internetrr�twisted.internet.interfacesr�twisted.pythonrr�Protocolr
r!�namedAny�argv�install�startLogging�openr�halfCloseProtocol�
StandardIO�run�exitrrrr�<module>r7s���
��&�,�>�'�
�
#�$�#
��)�)�#
�%�#
�L�z���G���S�X�X�a�[�!�)�)�+��C���T�#�(�(�1�+�t�,�-�(�)�+���E���&�'��G�K�K�M��C�H�H�
�
'�
'�(�r

Zerion Mini Shell 1.0