Added json indent
This commit is contained in:
parent
e59b36fcd1
commit
9f5c59f376
@ -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:
|
||||||
|
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user