Skip to content

Class peagen.tui.components.templates_view.TemplatesView

peagen.tui.components.templates_view.TemplatesView

TemplatesView(*args, **kwargs)

Bases: Tree

View template-set and prompt template files.

🚧 editing/saving not yet supported

Source code in peagen/tui/components/templates_view.py
16
17
def __init__(self, *args, **kwargs) -> None:
    super().__init__("templates", *args, **kwargs)

on_mount

on_mount()

Populate the tree from the bundled template directory.

Source code in peagen/tui/components/templates_view.py
19
20
21
22
23
def on_mount(self) -> None:  # noqa: D401 – Textual hook
    """Populate the tree from the bundled template directory."""
    root = Path(__file__).resolve().parents[2] / "template_sets"
    self.root.expand()
    self._build_tree(root, self.root)