o
    b                     @   s   d Z ddlZddlmZmZ ddlmZ ddlmZm	Z	 dd Z
G dd	 d	ejZed
krMe	ejd   ddlmZ eeejd  e  dS dS )z
Main program for the child process run by
L{twisted.test.test_stdio.StandardInputOutputTests.test_consumer} to test
that process transports implement IConsumer properly.
    N)protocolstdio)basic)logreflectc                 C   s   t tj t |  d S N)r   startLoggingsysstderrerr)r    r   B/usr/lib/python3/dist-packages/twisted/test/stdio_test_consumer.pyfailed   s   r   c                   @   s$   e Zd Zdd Zdd Zdd ZdS )ConsumerChildc                 C   s
   || _ d S r   )junkPath)selfr   r   r   r   __init__   s   
zConsumerChild.__init__c                    s:   t  t jd j}|t | fdd d S )Nrbc                    s
    j  S r   )	transportloseConnection)ignr   r   r   <lambda>!   s   
 z.ConsumerChild.connectionMade.<locals>.<lambda>)	r   
FileSenderbeginFileTransferopenr   r   
addErrbackr   addCallback)r   dr   r   r   connectionMade   s
   
zConsumerChild.connectionMadec                 C   s   t   d S r   )reactorstop)r   reasonr   r   r   connectionLost#   s   zConsumerChild.connectionLostN)__name__
__module____qualname__r   r   r#   r   r   r   r   r      s    r   __main__   )r       )__doc__r	   twisted.internetr   r   twisted.protocolsr   twisted.pythonr   r   r   Protocolr   r$   namedAnyargvinstallr    
StandardIOrunr   r   r   r   <module>   s   