Ë
    ojÿ  ã                   óÒ  — d Z ddlZddlmZ ddlmZmZ ddlmZ ddl	m
Z
mZ  ee«       G d„ dej                  «      «       Zed	k(  r  ej                  ej                   d
   «      j#                  «         e
j$                   eej                   d   d«      «       ddlmZ  e«       Z ej,                  e«        ej.                  «         ej0                  ej2                  «       yy)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                   ó,   — e Zd ZdZdZd„ Zd„ Zd„ Zd„ Zy)Ú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                 ó:   — | j                   j                  d«       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| _         t        j                  «        y)zv
        This is the desired event.  Once it has happened, stop the reactor so
        the process will exit.
        r   N)ÚexitCodeÚreactorÚstopr   s    r   ÚreadConnectionLostz$HalfCloseProtocol.readConnectionLost&   s   € ð
 ˆŒÜ�‰�r   c                 ó~   — | j                   €d| _         t        j                  |d«       t        j                  «        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)r   r   Úerrr   r   )r   Úreasons     r   ÚconnectionLostz HalfCloseProtocol.connectionLost.   s-   € ð
 �=‰=Ð ØˆDŒMÜ�G‰G�FÐ?Ô@Ü�‰�r   c                  ó   — y )N© r   s    r   ÚwriteConnectionLostz%HalfCloseProtocol.writeConnectionLost8   s   € àr   )	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r    r   r   r   r
   r
      s"   „ ñð €Hò#òòór   r
   Ú__main__r   é   Úwb)r   )r$   ÚsysÚzope.interfacer   Útwisted.internetr   r   Útwisted.internet.interfacesr   Útwisted.pythonr   r   ÚProtocolr
   r!   ÚnamedAnyÚargvÚinstallÚstartLoggingÚopenr   ÚhalfCloseProtocolÚ
StandardIOÚrunÚexitr   r   r   r   ú<module>r7      sÏ   ðñ
ó å &ç ,Ý >ß 'ñ Ð#Ó$ô#˜×)Ñ)ó #ó %ð#ðL ˆzÒØ€G×Ñ�S—X‘X˜a‘[Ó!×)Ñ)Ô+Ø€C×Ñ‘T˜#Ÿ(™( 1™+ tÓ,Ô-Ý(á)Ó+ÐØ€E×ÑÐ&Ô'Ø€G‡K�K„MØ€C‡H�HÐ×'Ñ'Õ(ð r   