f
This commit is contained in:
@@ -680,19 +680,37 @@ def main() -> int:
|
||||
"""Show a simple interactive menu to choose install/uninstall or delegate."""
|
||||
try:
|
||||
installed = _is_installed()
|
||||
term_width = shutil.get_terminal_size((80, 20)).columns
|
||||
while True:
|
||||
os.system("cls" if os.name == "nt" else "clear")
|
||||
print("====================================")
|
||||
print(" MEDEIA MACINA BOOTSTRAP MENU")
|
||||
print("====================================")
|
||||
print("1) Install / Reinstall")
|
||||
print("2) Extras > HydrusNetwork")
|
||||
if installed:
|
||||
print("3) Uninstall")
|
||||
print("4) Status")
|
||||
print("q) Quit")
|
||||
# Center the logo
|
||||
logo_lines = LOGO.strip().splitlines()
|
||||
# Filter out the ruler lines if they are still there
|
||||
logo_lines = [line for line in logo_lines if not any(c.isdigit() for c in line.strip())]
|
||||
|
||||
choice = input("\nChoose an option: ").strip().lower()
|
||||
print("\n" * 2)
|
||||
for line in logo_lines:
|
||||
print(line.center(term_width))
|
||||
|
||||
print("\n")
|
||||
menu_title = " MEDEIA MACINA BOOTSTRAP MENU "
|
||||
border = "=" * len(menu_title)
|
||||
print(border.center(term_width))
|
||||
print(menu_title.center(term_width))
|
||||
print(border.center(term_width))
|
||||
print("\n")
|
||||
|
||||
install_text = "1) Reinstall" if installed else "1) Install"
|
||||
print(install_text.center(term_width))
|
||||
print("2) Extras > HydrusNetwork".center(term_width))
|
||||
if installed:
|
||||
print("3) Uninstall".center(term_width))
|
||||
print("q) Quit".center(term_width))
|
||||
|
||||
prompt = "\nChoose an option: "
|
||||
# Try to center the prompt roughly
|
||||
indent = " " * ((term_width // 2) - (len(prompt) // 2))
|
||||
choice = input(f"{indent}{prompt}").strip().lower()
|
||||
|
||||
if choice in ("1", "install", "reinstall"):
|
||||
return "install"
|
||||
@@ -703,11 +721,6 @@ def main() -> int:
|
||||
if installed and choice in ("3", "uninstall"):
|
||||
return "uninstall"
|
||||
|
||||
if installed and choice in ("4", "status"):
|
||||
print("\nInstallation detected." if installed else "\nNot installed.")
|
||||
input("\nPress Enter to continue...")
|
||||
continue
|
||||
|
||||
if choice in ("q", "quit", "exit"):
|
||||
return 0
|
||||
except EOFError:
|
||||
@@ -910,7 +923,14 @@ def main() -> int:
|
||||
if not args.quiet and not args.debug:
|
||||
# Clear the terminal before showing logo
|
||||
os.system('cls' if os.name == 'nt' else 'clear')
|
||||
print(LOGO)
|
||||
term_width = shutil.get_terminal_size((80, 20)).columns
|
||||
logo_lines = LOGO.strip().splitlines()
|
||||
# Filter out the ruler lines
|
||||
logo_lines = [line for line in logo_lines if not any(c.isdigit() for c in line.strip())]
|
||||
print("\n" * 2)
|
||||
for line in logo_lines:
|
||||
print(line.center(term_width))
|
||||
print("\n")
|
||||
|
||||
# Determine total steps for progress bar
|
||||
total_steps = 7 # Base: venv, pip, deps, project, cli, finalize, env
|
||||
|
||||
Reference in New Issue
Block a user