From 4f7b102e5be46bb0c72de80726a626c11c418013 Mon Sep 17 00:00:00 2001 From: "Arno.Edwards" <138990495+Umpire2018@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:46:44 +0800 Subject: [PATCH] Fix missing 'theme' key handling in style configuration - Addressed the KeyError when 'theme' is absent in arguments. - Set the default to 'dark' theme when not specified. --- pilot/utils/arguments.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pilot/utils/arguments.py b/pilot/utils/arguments.py index 3347b005f3..8aafe9ba7d 100644 --- a/pilot/utils/arguments.py +++ b/pilot/utils/arguments.py @@ -26,11 +26,9 @@ def get_arguments(): else: arguments[arg] = True - if 'theme' not in arguments: - arguments['theme'] = 'dark' - theme_mapping = {'light': style_config.theme.LIGHT, 'dark': style_config.theme.DARK} - style_config.set_theme(theme=theme_mapping.get(arguments['theme'], style_config.theme.DARK)) + theme_value = arguments.get('theme', 'dark') + style_config.set_theme(theme=theme_mapping.get(theme_value, style_config.theme.DARK)) if 'user_id' not in arguments: arguments['user_id'] = username_to_uuid(getuser())