diff options
| author | Brian Potchik <brian@vector35.com> | 2025-04-27 10:29:51 -0400 |
|---|---|---|
| committer | Brian Potchik <brian@vector35.com> | 2025-04-27 10:29:51 -0400 |
| commit | 54990215c2ad8bda17de857a7fe97d9a7559364f (patch) | |
| tree | c48f5215c7b9bc4b70391dc8aea48bf72193e9ca /python | |
| parent | af87287534221d6c5b0e3425dfcbc84800b7c2f0 (diff) | |
Add initial Workflow Monitor UI and support for nested subflows.
Diffstat (limited to 'python')
| -rw-r--r-- | python/workflow.py | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/python/workflow.py b/python/workflow.py index d118b9f5..ba20591f 100644 --- a/python/workflow.py +++ b/python/workflow.py @@ -643,31 +643,27 @@ class WorkflowMachine: return json.loads(core.BNPostWorkflowRequestForBinaryView(self.handle, request)) def configure(self, advanced: bool = True, incremental: bool = False): - request = json.dumps({"command": "configure", "advanced": advanced, "incremental": incremental}) if self.is_function_machine: + request = json.dumps({"command": "configure", "advanced": advanced, "incremental": incremental}) return json.loads(core.BNPostWorkflowRequestForFunction(self.handle, request)) else: + request = json.dumps({"command": "configure"}) return json.loads(core.BNPostWorkflowRequestForBinaryView(self.handle, request)) - def resume(self): - request = json.dumps({"command": "run"}) + def resume(self, advanced: bool = True, incremental: bool = False): if self.is_function_machine: + request = json.dumps({"command": "resume", "advanced": advanced, "incremental": incremental}) return json.loads(core.BNPostWorkflowRequestForFunction(self.handle, request)) else: + request = json.dumps({"command": "resume"}) return json.loads(core.BNPostWorkflowRequestForBinaryView(self.handle, request)) - def run(self): - status = self.status() - if 'machineState' in status and 'state' in status['machineState']: - if status['machineState']['state'] == 'Idle': - self.configure() - else: - raise AttributeError("Unknown status response!") - - request = json.dumps({"command": "run"}) + def run(self, advanced: bool = True, incremental: bool = False): if self.is_function_machine: + request = json.dumps({"command": "run", "advanced": advanced, "incremental": incremental}) return json.loads(core.BNPostWorkflowRequestForFunction(self.handle, request)) else: + request = json.dumps({"command": "run"}) return json.loads(core.BNPostWorkflowRequestForBinaryView(self.handle, request)) def halt(self): @@ -783,8 +779,8 @@ class WorkflowMachineCLI(cmd.Cmd): "l": "log", "m": "metrics", "d": "dump", - "c": "resume", "r": "run", + "c": "resume", "h": "halt", "s": "step", "b": "breakpoint", |
