Files
wecom_it_smart_desk/_analyze_c.py
T

16 lines
579 B
Python
Raw Normal View History

2026-08-11 14:15:36 +08:00
import json, os, collections
d = json.load(open('docs_cmp_result2.json', encoding='utf-8'))
C = d['truly_missing'] # [path, mtime, size]
print("C类总数:", len(C))
grp = collections.defaultdict(list)
for p, mt, sz in C:
top = p.split('\\')[0]
grp[top].append((p, sz))
for top in sorted(grp, key=lambda k: -len(grp[k])):
items = grp[top]
print("\n### %s (%d 个)" % (top, len(items)))
for p, sz in items[:8]:
print(" %s (%dKB)" % (os.path.basename(p), sz // 1024))
if len(items) > 8:
print(" ... 其余 %d" % (len(items) - 8))