From 9f5c59f376a5b41a3989b442f4c13afcd333a6f6 Mon Sep 17 00:00:00 2001 From: profitroll Date: Sat, 6 May 2023 17:51:07 +0200 Subject: [PATCH] Added json indent --- modules/utils.py | 2 +- modules/utils_sync.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/utils.py b/modules/utils.py index 23430e8..a7d005e 100644 --- a/modules/utils.py +++ b/modules/utils.py @@ -12,7 +12,7 @@ async def json_read(path: str) -> Any: async def json_write(data: Any, path: str) -> None: async with aiofiles.open(path, mode="w", encoding="utf-8") as f: - await f.write(dumps(data, ensure_ascii=False, escape_forward_slashes=False)) + await f.write(dumps(data, ensure_ascii=False, escape_forward_slashes=False, indent=4)) async def config_get(key: str, *path: str) -> Any: diff --git a/modules/utils_sync.py b/modules/utils_sync.py index 318db58..3b6660f 100644 --- a/modules/utils_sync.py +++ b/modules/utils_sync.py @@ -12,7 +12,7 @@ def json_read_sync(path: str) -> Any: def json_write_sync(data: Any, path: str) -> None: with open(path, mode="w", encoding="utf-8") as f: - f.write(dumps(data, ensure_ascii=False, escape_forward_slashes=False)) + f.write(dumps(data, ensure_ascii=False, escape_forward_slashes=False, indent=4)) def config_get_sync(key: str, *path: str) -> Any: