| OLD | NEW |
| (Empty) |
| 1 # -*- test-case-name: twisted.test.test_stdio.StandardInputOutputTestCase.test_w
riteSequence -*- | |
| 2 # Copyright (c) 2006-2007 Twisted Matrix Laboratories. | |
| 3 # See LICENSE for details. | |
| 4 | |
| 5 """ | |
| 6 Main program for the child process run by | |
| 7 L{twisted.test.test_stdio.StandardInputOutputTestCase.test_writeSequence} to tes
t that | |
| 8 ITransport.writeSequence() works for process transports. | |
| 9 """ | |
| 10 | |
| 11 import sys | |
| 12 | |
| 13 from twisted.internet import stdio, protocol | |
| 14 from twisted.python import reflect | |
| 15 | |
| 16 class WriteSequenceChild(protocol.Protocol): | |
| 17 def connectionMade(self): | |
| 18 self.transport.writeSequence(list('ok!')) | |
| 19 self.transport.loseConnection() | |
| 20 | |
| 21 | |
| 22 def connectionLost(self, reason): | |
| 23 reactor.stop() | |
| 24 | |
| 25 | |
| 26 if __name__ == '__main__': | |
| 27 reflect.namedAny(sys.argv[1]).install() | |
| 28 from twisted.internet import reactor | |
| 29 stdio.StandardIO(WriteSequenceChild()) | |
| 30 reactor.run() | |
| OLD | NEW |