diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/workflow.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/python/workflow.py b/python/workflow.py index bda6c5cb..d118b9f5 100644 --- a/python/workflow.py +++ b/python/workflow.py @@ -464,7 +464,7 @@ class Workflow(metaclass=_WorkflowMetaclass): finally: core.BNFreeStringList(result, length.value) - def assign_subactivities(self, activity: Activity, activities: List[str]) -> bool: + def assign_subactivities(self, activity: Activity, activities: Union[List[str], str]) -> bool: """ ``assign_subactivities`` Assign the list of ``activities`` as the new set of children for the specified ``activity``. @@ -473,6 +473,8 @@ class Workflow(metaclass=_WorkflowMetaclass): :return: True on success, False otherwise :rtype: bool """ + if isinstance(activities, str): + activities = [activities] input_list = (ctypes.c_char_p * len(activities))() for i in range(0, len(activities)): input_list[i] = str(activities[i]).encode('charmap') @@ -529,12 +531,12 @@ class Workflow(metaclass=_WorkflowMetaclass): """ return core.BNWorkflowRemove(self.handle, str(activity)) - def replace(self, activity: ActivityType, new_activity: List[str]) -> bool: + def replace(self, activity: ActivityType, new_activity: str) -> bool: """ ``replace`` Replace the specified ``activity``. :param str activity: the Activity to replace - :param list[str] new_activity: the replacement Activity + :param str new_activity: the replacement Activity :return: True on success, False otherwise :rtype: bool """ @@ -704,6 +706,8 @@ class WorkflowMachine: return json.loads(core.BNPostWorkflowRequestForBinaryView(self.handle, request)) def breakpoint_delete(self, activities): + if isinstance(activities, str): + activities = [activities] request = json.dumps({"command": "breakpoint", "action": "delete", "activities": activities}) if self.is_function_machine: return json.loads(core.BNPostWorkflowRequestForFunction(self.handle, request)) @@ -718,6 +722,8 @@ class WorkflowMachine: return json.loads(core.BNPostWorkflowRequestForBinaryView(self.handle, request)) def breakpoint_set(self, activities): + if isinstance(activities, str): + activities = [activities] request = json.dumps({"command": "breakpoint", "action": "set", "activities": activities}) if self.is_function_machine: return json.loads(core.BNPostWorkflowRequestForFunction(self.handle, request)) |
