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

Side by Side Diff: third_party/twisted_8_1/twisted/test/process_twisted.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 """A process that reads from stdin and out using Twisted."""
2
3 ### Twisted Preamble
4 # This makes sure that users don't have to set up their environment
5 # specially in order to run these programs from bin/.
6 import sys, os, string
7 pos = string.find(os.path.abspath(sys.argv[0]), os.sep+'Twisted')
8 if pos != -1:
9 sys.path.insert(0, os.path.abspath(sys.argv[0])[:pos+8])
10 sys.path.insert(0, os.curdir)
11 ### end of preamble
12
13
14 from twisted.python import log
15 from zope.interface import implements
16 from twisted.internet import interfaces
17
18 log.startLogging(sys.stderr)
19
20 from twisted.internet import protocol, reactor, stdio
21
22
23 class Echo(protocol.Protocol):
24 implements(interfaces.IHalfCloseableProtocol)
25
26 def connectionMade(self):
27 print "connection made"
28
29 def dataReceived(self, data):
30 self.transport.write(data)
31
32 def readConnectionLost(self):
33 print "readConnectionLost"
34 self.transport.loseConnection()
35 def writeConnectionLost(self):
36 print "writeConnectionLost"
37
38 def connectionLost(self, reason):
39 print "connectionLost", reason
40 reactor.stop()
41
42 stdio.StandardIO(Echo())
43 reactor.run()
OLDNEW
« no previous file with comments | « third_party/twisted_8_1/twisted/test/process_tty.py ('k') | third_party/twisted_8_1/twisted/test/proto_helpers.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698