(self, cmd)
| 382 | return json.loads(result) |
| 383 | |
| 384 | def _write_command(self, cmd): |
| 385 | cmd_str = json.dumps(cmd) |
| 386 | cmd_array = bytearray(cmd_str, 'utf-8') |
| 387 | # append null byte |
| 388 | cmd_array += b'\x00' |
| 389 | self._caves_sock.send(bytes(cmd_array)) |
| 390 | |
| 391 | def _round_trip_command(self, cmd): |
| 392 | self._write_command(cmd) |