kkpyutil 1.39.0__tar.gz → 1.40.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.39.0 → kkpyutil-1.40.0}/PKG-INFO +1 -1
- {kkpyutil-1.39.0 → kkpyutil-1.40.0}/kkpyutil.py +24 -1
- {kkpyutil-1.39.0 → kkpyutil-1.40.0}/pyproject.toml +1 -1
- {kkpyutil-1.39.0 → kkpyutil-1.40.0}/LICENSE +0 -0
- {kkpyutil-1.39.0 → kkpyutil-1.40.0}/README.md +0 -0
- {kkpyutil-1.39.0 → kkpyutil-1.40.0}/kkpyutil_helper/windows/kkttssave.ps1 +0 -0
- {kkpyutil-1.39.0 → kkpyutil-1.40.0}/kkpyutil_helper/windows/kkttsspeak.ps1 +0 -0
|
@@ -2952,8 +2952,31 @@ def json_from_text(json_str):
|
|
|
2952
2952
|
return None, e
|
|
2953
2953
|
|
|
2954
2954
|
|
|
2955
|
+
class OfflineJSON:
|
|
2956
|
+
def __init__(self, file_path):
|
|
2957
|
+
self.path = file_path
|
|
2958
|
+
|
|
2959
|
+
def exists(self):
|
|
2960
|
+
return osp.isfile(self.path)
|
|
2961
|
+
|
|
2962
|
+
def load(self):
|
|
2963
|
+
return load_json(self.path) if self.exists() else None
|
|
2964
|
+
|
|
2965
|
+
def save(self, data: dict):
|
|
2966
|
+
save_json(self.path, data)
|
|
2967
|
+
|
|
2968
|
+
def merge(self, props: dict):
|
|
2969
|
+
data = self.load()
|
|
2970
|
+
if not data:
|
|
2971
|
+
return self.save(props)
|
|
2972
|
+
data.update(props)
|
|
2973
|
+
self.save(data)
|
|
2974
|
+
return data
|
|
2975
|
+
|
|
2976
|
+
|
|
2955
2977
|
def _test():
|
|
2956
|
-
print(say('hello'))
|
|
2978
|
+
# print(say('hello'))
|
|
2979
|
+
print(create_guid())
|
|
2957
2980
|
|
|
2958
2981
|
|
|
2959
2982
|
if __name__ == '__main__':
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|