kkpyutil 1.38.1__tar.gz → 1.39.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {kkpyutil-1.38.1 → kkpyutil-1.39.0}/PKG-INFO +1 -1
- {kkpyutil-1.38.1 → kkpyutil-1.39.0}/kkpyutil.py +12 -0
- {kkpyutil-1.38.1 → kkpyutil-1.39.0}/pyproject.toml +1 -1
- {kkpyutil-1.38.1 → kkpyutil-1.39.0}/LICENSE +0 -0
- {kkpyutil-1.38.1 → kkpyutil-1.39.0}/README.md +0 -0
- {kkpyutil-1.38.1 → kkpyutil-1.39.0}/kkpyutil_helper/windows/kkttssave.ps1 +0 -0
- {kkpyutil-1.38.1 → kkpyutil-1.39.0}/kkpyutil_helper/windows/kkttsspeak.ps1 +0 -0
|
@@ -2936,8 +2936,20 @@ def remove_unsupported_dict_keys(mydict: dict, supported_keys: set):
|
|
|
2936
2936
|
return mydict
|
|
2937
2937
|
|
|
2938
2938
|
|
|
2939
|
+
def json_to_text(obj, use_unicode=True, pretty=False):
|
|
2940
|
+
try:
|
|
2941
|
+
json_str = json.dumps(obj, ensure_ascii=not use_unicode, indent=4 if pretty else None)
|
|
2942
|
+
return json_str, None
|
|
2943
|
+
except TypeError as e:
|
|
2944
|
+
return None, e
|
|
2939
2945
|
|
|
2940
2946
|
|
|
2947
|
+
def json_from_text(json_str):
|
|
2948
|
+
try:
|
|
2949
|
+
data = json.loads(json_str)
|
|
2950
|
+
return data, None
|
|
2951
|
+
except json.JSONDecodeError as e:
|
|
2952
|
+
return None, e
|
|
2941
2953
|
|
|
2942
2954
|
|
|
2943
2955
|
def _test():
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|