MCPcopy
hub / github.com/walter201230/Python / main

Function main

tools/find_remaining_images.py:11–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9
10
11def main() -> int:
12 root = Path("Article")
13 by_file: dict[Path, list[str]] = defaultdict(list)
14 for md in sorted(root.rglob("*.md")):
15 for m in IMG_RE.finditer(md.read_text(encoding="utf-8")):
16 by_file[md].append(m.group(1))
17
18 if not by_file:
19 print("无剩余 http(s) 图片引用 ✓")
20 return 0
21
22 total = sum(len(v) for v in by_file.values())
23 print(f"剩余 {total} 个 http(s) 图片引用,分布在 {len(by_file)} 个文件:\n")
24 for path, urls in sorted(by_file.items(), key=lambda kv: -len(kv[1])):
25 print(f" {len(urls):>3} {path}")
26 return 1
27
28
29if __name__ == "__main__":

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected