Your IP : 216.73.217.13


Current Path : /lib/python3/dist-packages/twisted/test/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/twisted/test/__pycache__/stdio_test_producer.cpython-38.pyc

U


W[��@s�dZddlmZmZddlZddlmZmZddlm	Z	m
Z
Gdd�dej�Ze
dkr�e
�ejd	���dd
lmZe�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@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)�
ProducerChildF�cCst�d�t�dtj�dS)Nz*****OVER*****�)r�msg�reactor�	callLater�stop)�self�reason�r�B/usr/lib/python3/dist-packages/twisted/test/stdio_test_producer.py�connectionLosts
zProducerChild.connectionLostcCsf|j|7_|jr6t�tj�t�d�|j��n,|j�	|�|j�
d�rZ|j��n|��dS)Nz$dataReceived while transport paused!s
0
)�buf�_pausedrZstartLogging�sys�stderrr�	transportZloseConnection�write�endswith�pause)r�datarrr�dataReceiveds
zProducerChild.dataReceivedcCs"d|_|j��t�d|j�dS)NTg{�G�z�?)rrZpauseProducingrr
�unpause�rrrrr+s
zProducerChild.pausecCsd|_|j��dS)NF)rrZresumeProducingrrrrr1szProducerChild.unpauseN)	�__name__�
__module__�__qualname__rrrrrrrrrrrsr�__main__r
)r)�__doc__Z
__future__rrrZtwisted.internetrrZtwisted.pythonrrZProtocolrr ZnamedAny�argv�installrZ
StandardIO�runrrrr�<module>s#