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

Function run_recent

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

Source from the content-addressed store, hash-verified

1530
1531 items = folder_sizes_report(root, top_n=max(1, top_n), include_hidden=include_hidden, follow_symlinks=follow, ignore=ignore)
1532 out = format_sizes_report(items) or t('placeholder_empty', lang)
1533 print(out)
1534 export_path = prompt_text(lang, "prompt_export", "")
1535 export_text(lang, export_path, out)
1536
1537def run_recent(lang: str) -> None:
1538 print(t("recent_title", lang))
1539 root = prompt_path(lang, Path("."))
1540 if not root.exists():
1541 print(t("err_path_missing", lang, path=root))
1542 return
1543 try:
1544 days = int(prompt_text(lang, "prompt_days", "7") or "7")
1545 except ValueError:
1546 days = 7
1547 try:
1548 top_n = int(prompt_text(lang, "prompt_top", "200") or "200")
1549 except ValueError:
1550 top_n = 200
1551 depth = prompt_int(lang, 10)
1552 hide_dot = yesno(lang, "prompt_hide_dot", False)
1553 include_hidden = not hide_dot
1554 follow = yesno(lang, "prompt_follow", False)
1555 ignore = normalize_patterns(prompt_text(lang, "prompt_ignore", ""))
1556
1557 items = list_recent_files(root, days=max(0, days), max_results=max(0, top_n), max_depth=depth, include_hidden=include_hidden, follow_symlinks=follow, ignore=ignore)
1558 out = format_recent(items) or t('placeholder_empty', lang)
1559 print(out)

Callers 1

menu_loopFunction · 0.70

Calls 10

printFunction · 0.85
tFunction · 0.70
prompt_pathFunction · 0.70
prompt_textFunction · 0.70
prompt_intFunction · 0.70
yesnoFunction · 0.70
normalize_patternsFunction · 0.70
list_recent_filesFunction · 0.70
format_recentFunction · 0.70
export_textFunction · 0.70

Tested by

no test coverage detected