INNER CODE UNIT · Python

watch_theme

antoniorodr/cronboard · src/cronboard/app.py:148

    def watch_theme(self, theme: str) -> None:
        """Watches the theme and saves it to the config file.

        Args:
            theme: The theme to watch.
        """

        try:
            self.config_path.parent.mkdir(parents=True, exist_ok=True)
            config = self.load_config()
            config["theme"] = theme
            with self.config_path.open("w") as f:
                f.write(tomlkit.dumps(config))
        except Exception as e:
            print(f"Warning: Failed to save theme: {e}")

    def on_tabs_tab_activated(self, event: Tabs.TabActivated) -> None:
        """Shows the content for the activated tab.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…