U
    
W[¶  ã                   @   sþ   d Z ddlmZmZmZ ddlZddlZej ej	d ¡ 
ejd ¡Zedkrve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.é    )ÚdivisionÚabsolute_importÚprint_functionNZTwistedéÿÿÿÿé   )Úlog)Úimplementer)Ú
interfaces)Ú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   ú>/usr/lib/python3/dist-packages/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__Z
__future__r   r   r   ÚsysÚosÚpathÚabspathÚargvÚfindÚsepÚposÚinsertÚcurdirZtwisted.pythonr   Zzope.interfacer   Ztwisted.internetr	   ZstartLoggingÚstderrr
   r   r   ZIHalfCloseableProtocolZProtocolr   Z
StandardIOÚrunr   r   r   r   Ú<module>   s   (