ó
[³XMc           @   s®   d  Z  d d l Z d d l m Z m Z d d l m Z m Z d e j f d „  ƒ  YZ	 e
 d k rª e j e j d ƒ j ƒ  d d	 l m Z e j e	 ƒ  ƒ e j ƒ  n  d S(
   s®   
Main program for the child process run by
L{twisted.test.test_stdio.StandardInputOutputTestCase.test_producer} to test
that process transports implement IProducer properly.
iÿÿÿÿN(   t   stdiot   protocol(   t   logt   reflectt   ProducerChildc           B   s8   e  Z e Z d  Z d „  Z d „  Z d „  Z d „  Z RS(   t    c         C   s$   t  j d ƒ t j d t j ƒ d  S(   Ns   *****OVER*****i   (   R   t   msgt   reactort	   callLatert   stop(   t   selft   reason(    (    sD   /usr/lib/python2.7/dist-packages/twisted/test/stdio_test_producer.pyt   connectionLost   s    c         C   s…   |  j  | 7_  |  j rE t j t j ƒ t j d ƒ |  j j ƒ  n< |  j j	 | ƒ |  j  j
 d ƒ rw |  j j ƒ  n
 |  j ƒ  d  S(   Ns$   dataReceived while transport paused!s   
0
(   t   buft   _pausedR   t   startLoggingt   syst   stderrR   t	   transportt   loseConnectiont   writet   endswitht   pause(   R
   t   bytes(    (    sD   /usr/lib/python2.7/dist-packages/twisted/test/stdio_test_producer.pyt   dataReceived   s    	c         C   s-   t  |  _ |  j j ƒ  t j d |  j ƒ d  S(   Ng{®Gáz„?(   t   TrueR   R   t   pauseProducingR   R   t   unpause(   R
   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/test/stdio_test_producer.pyR   (   s    	c         C   s   t  |  _ |  j j ƒ  d  S(   N(   t   FalseR   R   t   resumeProducing(   R
   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/test/stdio_test_producer.pyR   .   s    	(	   t   __name__t
   __module__R   R   R   R   R   R   R   (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/test/stdio_test_producer.pyR      s   			t   __main__i   (   R   (   t   __doc__R   t   twisted.internetR    R   t   twisted.pythonR   R   t   ProtocolR   R   t   namedAnyt   argvt   installR   t
   StandardIOt   run(    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/test/stdio_test_producer.pyt   <module>	   s   #