| 671 | return self.arguments |
| 672 | |
| 673 | def respond(self, body): |
| 674 | assert self.response is None |
| 675 | d = {"type": "response", "request_seq": self.seq, "command": self.command} |
| 676 | |
| 677 | if isinstance(body, Exception): |
| 678 | d["success"] = False |
| 679 | d["message"] = str(body) |
| 680 | else: |
| 681 | d["success"] = True |
| 682 | if body is not None and body != {}: |
| 683 | d["body"] = body |
| 684 | |
| 685 | with self.channel._send_message(d) as seq: |
| 686 | pass |
| 687 | self.response = Response(self.channel, seq, self, body) |
| 688 | |
| 689 | @staticmethod |
| 690 | def _parse(channel, message_dict): |