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

Function read_whitelist_file

main.py:175–191  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

173
174
175def read_whitelist_file():
176 ensure_whitelist_file()
177 paths = []
178 exts = []
179 try:
180 with open(WHITELIST_PATH, encoding="utf-8") as f:
181 for line in f:
182 line = line.strip()
183 if not line or line.startswith('#'):
184 continue
185 if line.startswith('.') or (not os.path.sep in line and len(line) <= 8):
186 exts.append(normalize_ext(line))
187 else:
188 paths.append(os.path.abspath(os.path.expandvars(line)))
189 except Exception:
190 logging.exception("读取白名单失败")
191 return paths, exts
192
193
194def ensure_config_defaults(config):

Callers 1

build_whitelistMethod · 0.85

Calls 2

ensure_whitelist_fileFunction · 0.85
normalize_extFunction · 0.85

Tested by

no test coverage detected