MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / get_theme

Function get_theme

cmd2/rich_utils.py:313–318  ·  view source on GitHub ↗

Get the application-wide theme. Initializes it on the first call.

()

Source from the content-addressed store, hash-verified

311
312
313def get_theme() -> Theme:
314 """Get the application-wide theme. Initializes it on the first call."""
315 global _APP_THEME # noqa: PLW0603
316 if _APP_THEME is None:
317 _APP_THEME = _create_default_theme()
318 return _APP_THEME
319
320
321def set_theme(styles: Mapping[str, StyleType] | None = None) -> None:

Callers 4

set_themeFunction · 0.85
__init__Method · 0.85
_build_config_keyMethod · 0.85
rich_text_to_stringFunction · 0.85

Calls 1

_create_default_themeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…