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

Function prompt_path

Scripts/Developer Base/Tree Explorer.py:957–971  ·  view source on GitHub ↗
(lang: str, default: Path)

Source from the content-addressed store, hash-verified

955
956# ------------------ Prompts (localized) ------------------
957def prompt_path(lang: str, default: Path) -> Path:
958 print(t("pick_path", lang))
959 print(" " + t("path_1", lang))
960 print(" " + t("path_2", lang))
961 print(" " + t("path_3", lang))
962 print(" " + t("path_4", lang))
963 choice = input(t("choice_1_4", lang)).strip() or "1"
964 if choice == "2":
965 return Path(os.environ.get("HOME", str(Path.home())))
966 if choice == "3":
967 return Path("/sdcard")
968 if choice == "4":
969 p = input(t("enter_path", lang)).strip()
970 return Path(p).expanduser() if p else default
971 return default
972
973def prompt_int(lang: str, default: int, key: str = "prompt_depth_default") -> int:
974 val = input(t(key, lang, default=default)).strip()

Callers 14

explorer_modeFunction · 0.70
run_quickFunction · 0.70
run_customFunction · 0.70
run_only_foldersFunction · 0.70
run_jsonFunction · 0.70
run_searchFunction · 0.70
run_topFunction · 0.70
run_empty_dirsFunction · 0.70
run_dupesFunction · 0.70
run_trash_patternFunction · 0.70
run_sizes_reportFunction · 0.70
run_recentFunction · 0.70

Calls 3

printFunction · 0.85
inputFunction · 0.85
tFunction · 0.70

Tested by

no test coverage detected