MCPcopy Create free account
hub / github.com/MearaY/StegaPy / _ask_file

Function _ask_file

cli.py:244–253  ·  view source on GitHub ↗
(msg: str, must_exist: bool = True)

Source from the content-addressed store, hash-verified

242 ))
243
244 def _ask_file(msg: str, must_exist: bool = True) -> str:
245 while True:
246 path = questionary.path(msg, only_directories=False).ask()
247 if path is None:
248 raise KeyboardInterrupt
249 path = path.strip()
250 if must_exist and not os.path.isfile(path):
251 console.print(f"[red]文件不存在:{path}[/red]")
252 else:
253 return path
254
255 def _ask_dir(msg: str) -> str:
256 path = questionary.path(msg, only_directories=True).ask()

Callers 1

run_interactiveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected