ó
[³XMc           @   s¯   d  Z  d d l Z d d l m Z d d l m Z d d l m Z d e f d „  ƒ  YZ d „  Z	 e
 d	 k r« e e j d
 ƒ j ƒ  d d l m Z e	 e e j d ƒ n  d S(   sà   
Main program for the child process run by
L{twisted.test.test_stdio.StandardInputOutputTestCase.test_lastWriteReceived}
to test that L{os.write} can be reliably used after
L{twisted.internet.stdio.StandardIO} has finished.
iÿÿÿÿN(   t   Protocol(   t
   StandardIO(   t   namedAnyt   LastWriteChildc           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s   | |  _  | |  _ d  S(   N(   t   reactort   magicString(   t   selfR   R   (    (    sE   /usr/lib/python2.7/dist-packages/twisted/test/stdio_test_lastwrite.pyt   __init__   s    	c         C   s$   |  j  j |  j ƒ |  j  j ƒ  d  S(   N(   t	   transportt   writeR   t   loseConnection(   R   (    (    sE   /usr/lib/python2.7/dist-packages/twisted/test/stdio_test_lastwrite.pyt   connectionMade   s    c         C   s   |  j  j ƒ  d  S(   N(   R   t   stop(   R   t   reason(    (    sE   /usr/lib/python2.7/dist-packages/twisted/test/stdio_test_lastwrite.pyt   connectionLost   s    (   t   __name__t
   __module__R   R   R   (    (    (    sE   /usr/lib/python2.7/dist-packages/twisted/test/stdio_test_lastwrite.pyR      s   		c         C   s'   t  |  | ƒ } t | ƒ |  j ƒ  d  S(   N(   R   R   t   run(   R   R   t   p(    (    sE   /usr/lib/python2.7/dist-packages/twisted/test/stdio_test_lastwrite.pyt   main#   s    
t   __main__i   (   R   i   (   t   __doc__t   syst   twisted.internet.protocolR    t   twisted.internet.stdioR   t   twisted.python.reflectR   R   R   R   t   argvt   installt   twisted.internetR   (    (    (    sE   /usr/lib/python2.7/dist-packages/twisted/test/stdio_test_lastwrite.pyt   <module>
   s   	