INNER CODE UNIT · Python
SettingsScreen
VisionForge-OU/foreman · src/foreman/tui/app.py:352
class SettingsScreen(Screen):
BINDINGS = [Binding("escape", "app.pop_screen", "Back")]
def compose(self) -> ComposeResult:
yield Header()
with VerticalScroll():
yield Static(id="cfg")
yield Footer()
def on_mount(self) -> None:
import yaml
cfg = self.app.controller.config
text = yaml.safe_dump(cfg.to_dict(), sort_keys=False)
path = self.app.controller.config_path()
self.query_one("#cfg", Static).update(
f"[b]Configuration[/b] (edit {path} directly; validated on load)\n\n{text}"
)