for condition in self.disables:
condition.is_active = False
- def adopt_from(self, todos: list[Todo]) -> None:
+ def adopt_from(self, todos: list[Todo]) -> bool:
"""As far as possible, fill unsatisfied dependencies from todos."""
+ adopted = False
for process_id in self.unsatisfied_dependencies:
for todo in [t for t in todos if t.process.id_ == process_id
and t not in self.children]:
self.add_child(todo)
+ adopted = True
break
+ return adopted
def make_missing_children(self, db_conn: DatabaseConnection) -> None:
"""Fill unsatisfied dependencies with new Todos."""