Added json indent

This commit is contained in:
Profitroll 2023-05-06 17:51:07 +02:00
parent e59b36fcd1
commit 9f5c59f376
2 changed files with 2 additions and 2 deletions

View File

@ -12,7 +12,7 @@ async def json_read(path: str) -> Any:
async def json_write(data: Any, path: str) -> None: async def json_write(data: Any, path: str) -> None:
async with aiofiles.open(path, mode="w", encoding="utf-8") as f: 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: async def config_get(key: str, *path: str) -> Any:

View File

@ -12,7 +12,7 @@ def json_read_sync(path: str) -> Any:
def json_write_sync(data: Any, path: str) -> None: def json_write_sync(data: Any, path: str) -> None:
with open(path, mode="w", encoding="utf-8") as f: 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: def config_get_sync(key: str, *path: str) -> Any: