o
    ¯bž  ã                   @   sê   d Z ddlZddlZej ejd ¡ ejd ¡Zedkr1ej 	dej ejd ¡ded … ¡ ej 	dej
¡ ddlmZ ddlmZ ddlmZ e ej¡ dd	lmZmZmZ eejƒG d
d„ dejƒƒZe eƒ ¡ e ¡  dS )z6A process that reads from stdin and out using Twisted.é    NÚTwistedéÿÿÿÿé   )Úimplementer)Ú
interfaces)Úlog)ÚprotocolÚreactorÚstdioc                   @   s4   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	d
„ ZdS )ÚEchoc                 C   ó   t dƒ d S )Nzconnection made©Úprint©Úself© r   ú>/usr/lib/python3/dist-packages/twisted/test/process_twisted.pyÚconnectionMade   ó   zEcho.connectionMadec                 C   s   | j  |¡ d S )N)Ú	transportÚwrite)r   Údatar   r   r   ÚdataReceived!   s   zEcho.dataReceivedc                 C   s   t dƒ | j ¡  d S )NÚreadConnectionLost)r   r   ÚloseConnectionr   r   r   r   r   $   s   zEcho.readConnectionLostc                 C   r   )NÚwriteConnectionLostr   r   r   r   r   r   (   r   zEcho.writeConnectionLostc                 C   s   t d|ƒ t ¡  d S )NÚconnectionLost)r   r	   Ústop)r   Úreasonr   r   r   r   +   s   
zEcho.connectionLostN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r   r   r   r      s    r   )Ú__doc__ÚosÚsysÚpathÚabspathÚargvÚfindÚsepÚposÚinsertÚcurdirÚzope.interfacer   Útwisted.internetr   Útwisted.pythonr   ÚstartLoggingÚstderrr   r	   r
   ÚIHalfCloseableProtocolÚProtocolr   Ú
StandardIOÚrunr   r   r   r   Ú<module>   s     (