ó måOc@s dZddlZddlZddlmZddlmZddlmZm Z ddl m Z m Z de j fd„ƒYZed kr e jejd ƒjƒe jeejd d ƒƒdd lmZeƒZ eje ƒejƒeje jƒndS(sÏ Main program for the child process run by L{twisted.test.test_stdio.StandardInputOutputTestCase.test_readConnectionLost} to test that IHalfCloseableProtocol.readConnectionLost works for process transports. iÿÿÿÿN(t implements(tIHalfCloseableProtocol(tstdiotprotocol(treflecttlogtHalfCloseProtocolcBs9eZdZeeƒdZd„Zd„Zd„Z RS(sÎ A protocol to hook up to stdio and observe its transport being half-closed. If all goes as expected, C{exitCode} will be set to C{0}; otherwise it will be set to C{1} to indicate failure. cCs|jjdƒdS(s= Signal the parent process that we're ready. txN(t transporttwrite(tself((sE/usr/lib/python2.7/dist-packages/twisted/test/stdio_test_halfclose.pytconnectionMadescCsd|_tjƒdS(sv This is the desired event. Once it has happened, stop the reactor so the process will exit. iN(texitCodetreactortstop(R ((sE/usr/lib/python2.7/dist-packages/twisted/test/stdio_test_halfclose.pytreadConnectionLost&s cCs9|jdkr+d|_tj|dƒntjƒdS(sŒ This may only be invoked after C{readConnectionLost}. If it happens otherwise, mark it as an error and shut down. is!Unexpected call to connectionLostN(R tNoneRterrR R(R treason((sE/usr/lib/python2.7/dist-packages/twisted/test/stdio_test_halfclose.pytconnectionLost/s N( t__name__t __module__t__doc__RRRR R RR(((sE/usr/lib/python2.7/dist-packages/twisted/test/stdio_test_halfclose.pyRs    t__main__iitw(R (Rtsyst _preambletzope.interfaceRttwisted.internet.interfacesRttwisted.internetRRttwisted.pythonRRtProtocolRRtnamedAnytargvtinstallt startLoggingtfileR t StandardIOtruntexitR (((sE/usr/lib/python2.7/dist-packages/twisted/test/stdio_test_halfclose.pyt s&