U
    2ÜŸjž  ã                   @   sê   d Z ddlZddlZej ejd ¡ ejd ¡Zedkrbe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.é    NZ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   s   t dƒ d S )Nzconnection made©Úprint©Úself© r   ú@/tmp/pip-unpacked-wheel-4b529toj/twisted/test/process_twisted.pyÚconnectionMade   s    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   ZloseConnectionr   r   r   r   r   $   s    zEcho.readConnectionLostc                 C   s   t dƒ d S )NÚwriteConnectionLostr   r   r   r   r   r   (   s    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ÚcurdirZzope.interfacer   Ztwisted.internetr   Ztwisted.pythonr   ZstartLoggingÚstderrr   r   r	   ZIHalfCloseableProtocolÚProtocolr
   Z
StandardIOÚrunr   r   r   r   Ú<module>   s   (