diff options
Diffstat (limited to 'gamechestcli/src')
| -rw-r--r-- | gamechestcli/src/gamechest/gameconfig.py | 11 |
1 files changed, 9 insertions, 2 deletions
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 |
