Handle breakpoint commands.
(self, line)
| 896 | print(json.dumps(status, indent=4)) |
| 897 | |
| 898 | def do_breakpoint(self, line): |
| 899 | """Handle breakpoint commands.""" |
| 900 | parser = argparse.ArgumentParser(exit_on_error=False) |
| 901 | parser.add_argument("action", choices=["delete", "set", "query"], help="Action to perform: delete, set, or, query.") |
| 902 | parser.add_argument("activities", type=str, nargs="*", help="The breakpoint(s) to set/delete.") |
| 903 | try: |
| 904 | args = parser.parse_args(line.split()) |
| 905 | args.activities = [activity[1:-1] if activity.startswith('"') and activity.endswith('"') else activity for activity in args.activities] |
| 906 | if args.action == "delete": |
| 907 | status = self.machine.breakpoint_delete(args.activities) |
| 908 | print(json.dumps(status, indent=4)) |
| 909 | elif args.action == "query": |
| 910 | status = self.machine.breakpoint_query() |
| 911 | accepted = status.get('commandStatus', {}).get('accepted', False) |
| 912 | if accepted: |
| 913 | response = status.pop("response", None) |
| 914 | print(json.dumps(status, indent=4)) |
| 915 | if accepted and response: |
| 916 | print(json.dumps(response, indent=None)) |
| 917 | elif args.action == "set": |
| 918 | status = self.machine.breakpoint_set(args.activities) |
| 919 | print(json.dumps(status, indent=4)) |
| 920 | except argparse.ArgumentError as e: |
| 921 | print("ArgumentError:", e) |
| 922 | except SystemExit: |
| 923 | pass |
| 924 | |
| 925 | def do_status(self, line): |
| 926 | """Retrieve the current machine status.""" |
nothing calls this directly
no test coverage detected