MCPcopy
hub / github.com/wechaty/python-wechaty / read_setting

Method read_setting

src/wechaty/utils/data_util.py:87–95  ·  view source on GitHub ↗

read the setting from file Returns: dict: the data of setting file

(self)

Source from the content-addressed store, hash-verified

85 self.save_setting({})
86
87 def read_setting(self) -> dict:
88 """read the setting from file
89
90 Returns:
91 dict: the data of setting file
92 """
93 with open(self.setting_file, 'r', encoding='utf-8') as f:
94 data = json.load(f)
95 return data
96
97 def save_setting(self, value: dict) -> None:
98 """update the plugin setting"""

Callers 4

__init__Method · 0.95
to_dictMethod · 0.95
test_simple_initMethod · 0.95
test_sub_settingMethod · 0.95

Calls 1

loadMethod · 0.45

Tested by 2

test_simple_initMethod · 0.76
test_sub_settingMethod · 0.76