Skip to content

Commit abfb95e

Browse files
committed
refactor: drop dead ExerciseTree.render_manifest
render_manifest had no callers (render_topic is the only one used); its Manifest/State type imports went with it. Left reset's name-based snapshot fallback in place — the reset unit tests construct Exercises with rel_path=None and depend on it.
1 parent 987a351 commit abfb95e

1 file changed

Lines changed: 0 additions & 19 deletions

File tree

pythonlings/widgets/exercise_tree.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,13 @@
77

88
if TYPE_CHECKING:
99
from pythonlings.core.exercise import Exercise
10-
from pythonlings.core.manifest import Manifest
11-
from pythonlings.core.state import State
1210

1311

1412
class ExerciseTree(Tree[str]):
1513
def __init__(self) -> None:
1614
super().__init__("exercises", id="tree")
1715
self.show_root = False
1816

19-
def render_manifest(
20-
self, manifest: "Manifest", state: "State", current: str | None
21-
) -> None:
22-
self.clear()
23-
topics: dict[str, object] = {}
24-
for ex in manifest.exercises:
25-
if ex.topic not in topics:
26-
topics[ex.topic] = self.root.add(ex.topic, expand=True)
27-
parent = topics[ex.topic]
28-
if ex.name in state.completed:
29-
marker = "✓"
30-
elif ex.name == current:
31-
marker = "●"
32-
else:
33-
marker = "🔒"
34-
parent.add_leaf(f"{marker} {ex.name}", data=ex.name)
35-
3617
def render_topic(
3718
self,
3819
topic: str,

0 commit comments

Comments
 (0)