MCPcopy
hub / github.com/tornadoweb/tornado / CapServer

Class CapServer

tornado/test/concurrent_test.py:79–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77
78
79class CapServer(TCPServer):
80 @gen.coroutine
81 def handle_stream(self, stream, address):
82 data = yield stream.read_until(b"\n")
83 data = to_unicode(data)
84 if data == data.upper():
85 stream.write(b"error\talready capitalized\n")
86 else:
87 # data already has \n
88 stream.write(utf8("ok\t%s" % data.upper()))
89 stream.close()
90
91
92class CapError(Exception):

Callers 1

setUpMethod · 0.85

Calls

no outgoing calls

Tested by 1

setUpMethod · 0.68