home · contact · privacy
Hide already-seen descendants of implicit ProcessSteps.
[plomtask] / plomtask / processes.py
index 23cded7bfb75020069219c6545e7c6843d1c0b20..0a7d5b5d67e4f17b33c52800f381295c12bd3b37 100644 (file)
@@ -2,7 +2,7 @@
 from __future__ import annotations
 from sqlite3 import Row
 from datetime import datetime
-from typing import Any
+from typing import Any, Set
 from plomtask.db import DatabaseConnection
 from plomtask.exceptions import NotFoundException, BadFormatException
 
@@ -88,10 +88,13 @@ class Process:
                                  if s.parent_step_id == node_id]
             for child in explicit_children:
                 node['steps'][child.id_] = make_node(child)
+            node['seen'] = node_id in seen_step_ids
+            seen_step_ids.add(node_id)
             for id_, step in node['steps'].items():
                 walk_steps(id_, step)
 
         steps: dict[int, dict[str, object]] = {}
+        seen_step_ids: Set[int] = set()
         if external_owner is None:
             external_owner = self
         for step in [s for s in self.explicit_steps