ó
[³XMc           @   sÑ   d  Z  d d l Z d d l m Z m Z d d l m Z m Z d d l m	 Z	 d „  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 d ƒ ƒ e j ƒ  n  d S(   s®   
Main program for the child process run by
L{twisted.test.test_stdio.StandardInputOutputTestCase.test_consumer} to test
that process transports implement IConsumer properly.
iÿÿÿÿN(   t   logt   reflect(   t   stdiot   protocol(   t   basicc         C   s!   t  j t j ƒ t  j |  ƒ d  S(   N(   R    t   startLoggingt   syst   stderrt   err(   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/test/stdio_test_consumer.pyt   failed   s    t   ConsumerChildc           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s   | |  _  d  S(   N(   t   junkPath(   t   selfR   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/test/stdio_test_consumer.pyt   __init__   s    c            sK   t  j ƒ  j t ˆ  j ƒ ˆ  j ƒ } | j t ƒ | j ‡  f d †  ƒ d  S(   Nc            s   ˆ  j  j ƒ  S(   N(   t	   transportt   loseConnection(   t   ign(   R   (    sD   /usr/lib/python2.7/dist-packages/twisted/test/stdio_test_consumer.pyt   <lambda>   s    (	   R   t
   FileSendert   beginFileTransfert   fileR   R   t
   addErrbackR	   t   addCallback(   R   t   d(    (   R   sD   /usr/lib/python2.7/dist-packages/twisted/test/stdio_test_consumer.pyt   connectionMade   s    $c         C   s   t  j ƒ  d  S(   N(   t   reactort   stop(   R   t   reason(    (    sD   /usr/lib/python2.7/dist-packages/twisted/test/stdio_test_consumer.pyt   connectionLost   s    (   t   __name__t
   __module__R   R   R   (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/test/stdio_test_consumer.pyR
      s   		t   __main__i   (   R   i   (   t   __doc__R   t   twisted.pythonR    R   t   twisted.internetR   R   t   twisted.protocolsR   R	   t   ProtocolR
   R   t   namedAnyt   argvt   installR   t
   StandardIOt   run(    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/test/stdio_test_consumer.pyt   <module>	   s   	