MCPcopy Create free account
hub / github.com/EasyIME/PIME / CapServer

Class CapServer

python/python3/tornado/test/concurrent_test.py:54–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52
53
54class CapServer(TCPServer):
55 @gen.coroutine
56 def handle_stream(self, stream, address):
57 data = yield stream.read_until(b"\n")
58 data = to_unicode(data)
59 if data == data.upper():
60 stream.write(b"error\talready capitalized\n")
61 else:
62 # data already has \n
63 stream.write(utf8("ok\t%s" % data.upper()))
64 stream.close()
65
66
67class CapError(Exception):

Callers 1

setUpMethod · 0.85

Calls

no outgoing calls

Tested by 1

setUpMethod · 0.68