MCPcopy Index your code
hub / github.com/Syncplay/syncplay / lineReceived

Method lineReceived

syncplay/protocols.py:40–55  ·  view source on GitHub ↗
(self, line)

Source from the content-addressed store, hash-verified

38 self.dropWithError(getMessage("unknown-command-server-error").format(message[1])) # TODO: log, not drop
39
40 def lineReceived(self, line):
41 try:
42 line = line.decode('utf-8').strip()
43 except UnicodeDecodeError:
44 self.dropWithError(getMessage("line-decode-server-error"))
45 return
46 if not line:
47 return
48 self.showDebugMessage("client/server << {}".format(line))
49 try:
50 messages = json.loads(line)
51 except json.decoder.JSONDecodeError:
52 self.dropWithError(getMessage("not-json-server-error").format(line))
53 return
54 else:
55 self.handleMessages(messages)
56
57 def sendMessage(self, dict_):
58 line = json.dumps(dict_)

Callers

nothing calls this directly

Calls 4

dropWithErrorMethod · 0.95
handleMessagesMethod · 0.95
getMessageFunction · 0.90
showDebugMessageMethod · 0.45

Tested by

no test coverage detected