|
@@ -29,12 +29,12 @@ def save_list(filename, list_obj, encoding='utf-8', append_break=True):
|
|
|
|
|
|
def load_json(filename, encoding='utf-8'):
|
|
|
with open(filename, 'r', encoding=encoding) as f:
|
|
|
- dict_obj = json.load(f, object_pairs_hook=OrderedDict)
|
|
|
- return dict_obj
|
|
|
+ data = json.load(f, object_pairs_hook=OrderedDict)
|
|
|
+ return data
|
|
|
|
|
|
|
|
|
-def save_json(filename, dict_obj, encoding='utf-8', sort_keys=False):
|
|
|
+def save_json(filename, data, encoding='utf-8', sort_keys=False):
|
|
|
with open(filename, 'w', encoding=encoding) as f:
|
|
|
- json.dump(dict_obj, f, indent=4, separators=(',',': '),
|
|
|
+ json.dump(data, f, indent=4, separators=(',',': '),
|
|
|
ensure_ascii=False, sort_keys=sort_keys)
|
|
|
|