MCPcopy
hub / github.com/blackboxo/CleanMyWechat / create_config

Method create_config

main.py:662–677  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

660 return False
661
662 def create_config(self):
663 if not os.path.exists(CONFIG_PATH):
664 if not self.check_wechat_exists():
665 self.setWarninginfo("默认位置没有微信,请自定义位置")
666 return
667
668 self.config = ensure_config_defaults({"data_dir": self.version_scan, "users": []})
669 for index, value in enumerate(self.users_scan):
670 data_dir = self.version_scan[index] if index < len(self.version_scan) else ""
671 self.config["users"].append(make_default_user_config(value, data_dir))
672 save_json(CONFIG_PATH, self.config)
673 self.load_config()
674 self.setSuccessinfo("请确认每个账号的删除内容及时间,以防误删!")
675 else:
676 self.setSuccessinfo("请确认每个账号的删除内容及时间,以防误删!")
677 self.load_config()
678
679 def update_config(self):
680 self.persist_current_config(notify=True, emit_signal=True)

Callers 1

__init__Method · 0.95

Calls 7

check_wechat_existsMethod · 0.95
load_configMethod · 0.95
ensure_config_defaultsFunction · 0.85
make_default_user_configFunction · 0.85
save_jsonFunction · 0.85
setWarninginfoMethod · 0.80
setSuccessinfoMethod · 0.80

Tested by

no test coverage detected