From 2c5a6d5f6ab4e7a9731b543c82830118221bc3b5 Mon Sep 17 00:00:00 2001 From: vg Date: Sat, 28 Feb 2026 17:56:06 +0100 Subject: git-sync on dita --- gamechestcli/src/gamechest/gameconfig.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'gamechestcli') diff --git a/gamechestcli/src/gamechest/gameconfig.py b/gamechestcli/src/gamechest/gameconfig.py index 9385dfd..4d58c08 100644 --- a/gamechestcli/src/gamechest/gameconfig.py +++ b/gamechestcli/src/gamechest/gameconfig.py @@ -37,7 +37,7 @@ class GameConfig: self.config = {} with contextlib.ExitStack() as stack: stack.enter_context(contextlib.suppress(FileNotFoundError)) - fdin = stack.enter_context(open(game_config_filepath, 'r', + fdin = stack.enter_context(open(game_config_filepath, encoding='utf8')) # in case yaml file is empty, None will be returned, in this case # fallback to empty dict. @@ -101,7 +101,14 @@ class GameConfig: return games_install_path def print_config(self): - print(json.dumps(self.config)) + print(json.dumps({ + k: ( + str(v) + if type(v) not in (None, str, int, bool) + else v + ) + for k, v in self.config.items() + })) # default instance of gameconfig, same instance intended to be shared through -- cgit v1.2.3