File: //lib/python3/dist-packages/twisted/test/__pycache__/stdio_test_producer.cpython-38.pyc
U
W[� � @ s� d Z ddlmZmZ ddlZddlmZmZ ddlm Z m
Z
G dd� dej�Ze
dkr�e
�ejd ��� dd
lmZ e�e� � e�� dS )z�
Main program for the child process run by
L{twisted.test.test_stdio.StandardInputOutputTests.test_producer} to test
that process transports implement IProducer properly.
� )�absolute_import�divisionN)�stdio�protocol)�log�reflectc @ s4 e Zd ZdZdZdd� Zdd� Zdd� Zd d
� ZdS )�
ProducerChildF� c C s t �d� t�dtj� d S )Nz*****OVER*****� )r �msg�reactor� callLater�stop)�self�reason� r �B/usr/lib/python3/dist-packages/twisted/test/stdio_test_producer.py�connectionLost s
zProducerChild.connectionLostc C sf | j |7 _ | jr6t�tj� t�d� | j�� n,| j� |� | j �
d�rZ| j�� n| �� d S )Nz$dataReceived while transport paused!s
0
)�buf�_pausedr ZstartLogging�sys�stderrr � transportZloseConnection�write�endswith�pause)r �datar r r �dataReceived s
zProducerChild.dataReceivedc C s"