Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: third_party/twisted_8_1/twisted/test/stdio_test_lastwrite.py

Issue 12261012: Remove third_party/twisted_8_1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 # -*- test-case-name: twisted.test.test_stdio.StandardInputOutputTestCase.test_l astWriteReceived -*-
2 # Copyright (c) 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_lastWriteReceived}
8 to test that L{os.write} can be reliably used after
9 L{twisted.internet.stdio.StandardIO} has finished.
10 """
11
12 import sys
13
14 from twisted.internet.protocol import Protocol
15 from twisted.internet.stdio import StandardIO
16 from twisted.python.reflect import namedAny
17
18
19 class LastWriteChild(Protocol):
20 def __init__(self, reactor, magicString):
21 self.reactor = reactor
22 self.magicString = magicString
23
24
25 def connectionMade(self):
26 self.transport.write(self.magicString)
27 self.transport.loseConnection()
28
29
30 def connectionLost(self, reason):
31 self.reactor.stop()
32
33
34
35 def main(reactor, magicString):
36 p = LastWriteChild(reactor, magicString)
37 StandardIO(p)
38 reactor.run()
39
40
41
42 if __name__ == '__main__':
43 namedAny(sys.argv[1]).install()
44 from twisted.internet import reactor
45 main(reactor, sys.argv[2])
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698