(lang: str, default: Path)
| 955 | |
| 956 | # ------------------ Prompts (localized) ------------------ |
| 957 | def 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 | |
| 973 | def prompt_int(lang: str, default: int, key: str = "prompt_depth_default") -> int: |
| 974 | val = input(t(key, lang, default=default)).strip() |
no test coverage detected