MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / format_dupes

Function format_dupes

Scripts/Developer Base/Tree Explorer.py:756–763  ·  view source on GitHub ↗
(lang: str, dupes: Dict[str, List[Path]])

Source from the content-addressed store, hash-verified

754 return {k: v for k, v in dupes.items() if len(v) > 1}
755
756def format_dupes(lang: str, dupes: Dict[str, List[Path]]) -> str:
757 lines: List[str] = []
758 for k, paths in sorted(dupes.items(), key=lambda kv: len(kv[1]), reverse=True):
759 _, digest, sz = k.split(":", 2)
760 lines.append(f"\n== {format_size(int(sz))} {digest} ({len(paths)} {t('label_files_word', lang)}) ==")
761 for p in paths:
762 lines.append(f" - {p}")
763 return "\n".join(lines).strip()
764
765
766# ------------------ Trash (safe move) ------------------

Callers 2

run_dupesFunction · 0.70
mainFunction · 0.70

Calls 2

format_sizeFunction · 0.70
tFunction · 0.70

Tested by

no test coverage detected