Воркед

This commit is contained in:
kromskii2 committed 2025-03-15 09:36:28 +07:00
1 parent ac32c55ab9
commit ee94d8e529
1138 files changed
+55771 -77901

No files matched your search

@@ -1,3 +1,4 @@
from pathlib import Path
from json import loads, dumps
from typing import Any, Callable, Optional, Union
@@ -27,7 +28,7 @@ class JSON:
indent: Union[None, int, str] = 2,
highlight: bool = True,
skip_keys: bool = False,
ensure_ascii: bool = True,
ensure_ascii: bool = False,
check_circular: bool = True,
allow_nan: bool = True,
default: Optional[Callable[[Any], Any]] = None,
@@ -56,7 +57,7 @@ class JSON:
indent: Union[None, int, str] = 2,
highlight: bool = True,
skip_keys: bool = False,
ensure_ascii: bool = True,
ensure_ascii: bool = False,
check_circular: bool = True,
allow_nan: bool = True,
default: Optional[Callable[[Any], Any]] = None,
@@ -102,7 +103,6 @@ class JSON:
if __name__ == "__main__":
import argparse
import sys
@@ -131,8 +131,7 @@ if __name__ == "__main__":
if args.path == "-":
json_data = sys.stdin.read()
else:
with open(args.path, "rt") as json_file:
json_data = json_file.read()
json_data = Path(args.path).read_text()
except Exception as error:
error_console.print(f"Unable to read {args.path!r}; {error}")
sys.exit(-1)