File: //lib/python3/dist-packages/twisted/test/__pycache__/stdio_test_consumer.cpython-310.pyc
o
�b� � @ s� d Z ddlZddlmZmZ ddlmZ ddlmZm Z dd� Z
G dd � d ej�Ze
d
krMe �ejd ��� ddlmZ e�eejd
�� e�� dS dS )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 �tj� 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 Zd Zdd� Zdd� Zdd� ZdS )�
ConsumerChildc C s
|| _ d S r )�junkPath)�selfr r r r
�__init__ s
zConsumerChild.__init__c s: t �� �t� jd�� j�}|�t� |�� fdd�� 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
�
zConsumerChild.connectionMadec C s t �� d S r )�reactor�stop)r �reasonr r r
�connectionLost# s zConsumerChild.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 �