diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..c727cea --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,16 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Python Debugger: Current File", + "type": "debugpy", + "request": "launch", + "program": "${file}", + "console": "integratedTerminal", + "args": ["C:\\Scripts\\rushti\\tasks_opt_case2.txt","4","opt"] + } + ] +} \ No newline at end of file diff --git a/__pycache__/utils.cpython-310.pyc b/__pycache__/utils.cpython-310.pyc new file mode 100644 index 0000000..17f7320 Binary files /dev/null and b/__pycache__/utils.cpython-310.pyc differ diff --git a/rushti.py b/rushti.py index c9b1cee..9572302 100644 --- a/rushti.py +++ b/rushti.py @@ -330,12 +330,16 @@ def extract_tasks_from_file_type_opt( tasks[task.id].append(task) # expand tasks + expanded_tasks = dict() if expand: for task_id in tasks: for task in tasks[task_id]: for expanded_task in expand_task(tm1_services, task): - tasks[task.id].append(expanded_task) - tasks[task.id].remove(task) + if task.id not in expanded_tasks: + expanded_tasks[task.id] = [expanded_task] + else: + expanded_tasks[task.id].append(expanded_task) + tasks = expanded_tasks # Populate the successors attribute for task_id in tasks: