diff options
| author | vg <vgm+dev@devys.org> | 2026-02-28 17:56:06 +0100 |
|---|---|---|
| committer | vg <vgm+dev@devys.org> | 2026-02-28 17:56:06 +0100 |
| commit | 2c5a6d5f6ab4e7a9731b543c82830118221bc3b5 (patch) | |
| tree | bb94b0f63afe905e43b5a17803faf5f9c9c0febf | |
| parent | 8e9d0ee3bed1f5aba33ec400a109ac115ff0dba5 (diff) | |
| download | gamechest-2c5a6d5f6ab4e7a9731b543c82830118221bc3b5.tar.gz gamechest-2c5a6d5f6ab4e7a9731b543c82830118221bc3b5.tar.bz2 gamechest-2c5a6d5f6ab4e7a9731b543c82830118221bc3b5.zip | |
git-sync on dita
| -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 |
