(self, line)
| 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_) |
nothing calls this directly
no test coverage detected