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

Function run_empty_dirs

Scripts/Developer Base/Tree Explorer.py:1427–1445  ·  view source on GitHub ↗
(lang: str)

Source from the content-addressed store, hash-verified

1425
1426 items = list_top_largest_files(root, top_n=max(1, n), max_depth=depth, include_hidden=include_hidden, follow_symlinks=follow, ignore=ignore, only=only)
1427 out = format_top_list(items) or t('placeholder_empty', lang)
1428 print(out)
1429 export_path = prompt_text(lang, "prompt_export", "")
1430 export_text(lang, export_path, out)
1431
1432def run_empty_dirs(lang: str) -> None:
1433 print(t("empty_title", lang))
1434 root = prompt_path(lang, Path("."))
1435 if not root.exists():
1436 print(t("err_path_missing", lang, path=root))
1437 return
1438 depth = prompt_int(lang, 8)
1439 hide_dot = yesno(lang, "prompt_hide_dot", False)
1440 include_hidden = not hide_dot
1441 follow = yesno(lang, "prompt_follow", False)
1442 ignore = normalize_patterns(prompt_text(lang, "prompt_ignore", ""))
1443
1444 empties = find_empty_folders(root, max_depth=depth, include_hidden=include_hidden, follow_symlinks=follow, ignore=ignore)
1445 print(t("empty_found", lang, n=len(empties)))
1446 out = "\n".join(str(p) for p in empties) if empties else ""
1447 if out:
1448 print(out)

Callers 1

menu_loopFunction · 0.70

Calls 9

printFunction · 0.85
tFunction · 0.70
prompt_pathFunction · 0.70
prompt_intFunction · 0.70
yesnoFunction · 0.70
normalize_patternsFunction · 0.70
prompt_textFunction · 0.70
find_empty_foldersFunction · 0.70
export_textFunction · 0.70

Tested by

no test coverage detected