- top_todos = [t for t in Todo.by_date(self.conn, date) if not t.parents]
- todo_trees = [t.get_undone_steps_tree() for t in top_todos]
- done_trees = []
- for t in top_todos:
- done_trees += t.get_done_steps_tree()
- condition_listings: list[ConditionListing] = []
- for cond in Condition.all(self.conn):
- enablers = Todo.enablers_for_at(self.conn, cond, date)
- disablers = Todo.disablers_for_at(self.conn, cond, date)
- condition_listings += [ConditionListing(cond, enablers, disablers)]
+ todays_todos = Todo.by_date(self.conn, date)
+ conditions_present = []
+ enablers_for = {}
+ for todo in todays_todos:
+ for condition in todo.conditions:
+ if condition not in conditions_present:
+ conditions_present += [condition]
+ enablers_for[condition.id_] = [p for p in
+ Process.all(self.conn)
+ if condition in p.enables]
+ seen_todos: set[int] = set()
+ top_nodes = [t.get_step_tree(seen_todos)
+ for t in todays_todos if not t.parents]