From 78e5f10f02f1545aa337e474784879fc51a157bf Mon Sep 17 00:00:00 2001 From: DavidoTek <54072917+DavidoTek@users.noreply.github.com> Date: Mon, 6 Jan 2025 15:41:50 +0100 Subject: [PATCH 1/2] steamutil: Do not raise an error in get_stream_vdf_compat_tool_mapping --- pupgui2/steamutil.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pupgui2/steamutil.py b/pupgui2/steamutil.py index 7d1db8d1..349435e1 100644 --- a/pupgui2/steamutil.py +++ b/pupgui2/steamutil.py @@ -24,14 +24,15 @@ _cached_steam_ctool_id_map = None -def get_steam_vdf_compat_tool_mapping(vdf_file: dict): +def get_steam_vdf_compat_tool_mapping(vdf_file: dict) -> dict: s = vdf_file.get('InstallConfigStore', {}).get('Software', {}) # Sometimes the key is 'Valve', sometimes 'valve', see #226 c = s.get('Valve') or s.get('valve') if not c: - raise KeyError('Error! config.vdf InstallConfigStore.Software neither contains key "Valve" nor "valve" - config.vdf file may be invalid!') + print('Error! config.vdf InstallConfigStore.Software neither contains key "Valve" nor "valve" - config.vdf file may be invalid!') + return {} m = c.get('Steam', {}).get('CompatToolMapping', {}) From 9e85d4896a92d34c384cd235645718fae8ecd607 Mon Sep 17 00:00:00 2001 From: DavidoTek <54072917+DavidoTek@users.noreply.github.com> Date: Mon, 6 Jan 2025 15:47:55 +0100 Subject: [PATCH 2/2] steamutil: Improve error messages --- pupgui2/steamutil.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pupgui2/steamutil.py b/pupgui2/steamutil.py index 349435e1..9b2b3665 100644 --- a/pupgui2/steamutil.py +++ b/pupgui2/steamutil.py @@ -89,7 +89,7 @@ def get_steam_app_list(steam_config_folder: str, cached=False, no_shortcuts=Fals apps = update_steamapp_info(steam_config_folder, apps) apps = update_steamapp_awacystatus(apps) except Exception as e: - print('Error: Could not get a list of all Steam apps:', e) + print('Error (get_steam_app_list): Could not get a list of all Steam apps:', e) else: if not no_shortcuts: apps.extend(get_steam_shortcuts_list(steam_config_folder, c)) @@ -145,7 +145,7 @@ def get_steam_shortcuts_list(steam_config_folder: str, compat_tools: dict=None) app.compat_tool = ct.get('name') apps.append(app) except Exception as e: - print('Error: Could not get a list of Steam shortcut apps:', e) + print('Error (get_steam_shortcuts_list): Could not get a list of Steam shortcut apps:', e) return apps @@ -766,7 +766,7 @@ def get_steam_user_list(steam_config_folder: str) -> List[SteamUser]: users.append(user) except Exception as e: - print('Error: Could not get a list of Steam users:', e) + print('Error (get_steam_user_list): Could not get a list of Steam users:', e) return users