From e2402f4e486ffb0f034df8b0ed206ea42f6745d9 Mon Sep 17 00:00:00 2001 From: evilchili Date: Wed, 21 Dec 2022 22:50:37 -0800 Subject: [PATCH] fix default theme selection --- groove/console.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/groove/console.py b/groove/console.py index 595fdce..3d592c6 100644 --- a/groove/console.py +++ b/groove/console.py @@ -26,7 +26,7 @@ BASE_STYLE = { } -def console_theme(theme_name: Union[str, None] = 'blue_train') -> dict: +def console_theme(theme_name: Union[str, None] = None) -> dict: """ Return a console theme as a dictionary. @@ -35,8 +35,10 @@ def console_theme(theme_name: Union[str, None] = 'blue_train') -> dict: """ cfg = ConfigParser() cfg.read_dict({'styles': BASE_STYLE}) + + theme_path = theme_name if theme_name else os.environ.get('DEFAULT_THEME', 'blue_train') cfg.read(theme( - Path(theme_name or os.environ['DEFAULT_THEME']) / Path('console.cfg') + Path(theme_path) / Path('console.cfg') )) return cfg['styles']