(self, message)
| 31 | 'utf-8', errors='ignore')) |
| 32 | |
| 33 | def textMessageReceived(self, message): |
| 34 | print('textMessageReceived:', message) |
| 35 | error = QJsonParseError() |
| 36 | json = QJsonDocument.fromJson(message.encode('utf-8', errors='ignore'), |
| 37 | error) |
| 38 | if error.error: |
| 39 | print('Failed to parse message:{}, Error is:{}'.format( |
| 40 | message, error.errorString())) |
| 41 | return |
| 42 | if not json.isObject(): |
| 43 | print('Received JSON message that is not an object:{}'.format( |
| 44 | message)) |
| 45 | return |
| 46 | self.messageReceived.emit(json.object(), self) |
| 47 | |
| 48 | |
| 49 | class WebChannelObject(QObject): |
nothing calls this directly
no outgoing calls
no test coverage detected