From 360633523dff14e9d4c9a220c1146550a4041629 Mon Sep 17 00:00:00 2001 From: developomp Date: Mon, 7 Nov 2022 16:59:35 +0900 Subject: [PATCH] remove unnecessary menu --- src/entry.py | 2 +- src/interface/__init__.py | 0 src/interface/menu.py | 46 --------------------- src/{interface/choose_action.py => menu.py} | 9 ++++ 4 files changed, 10 insertions(+), 47 deletions(-) delete mode 100644 src/interface/__init__.py delete mode 100644 src/interface/menu.py rename src/{interface/choose_action.py => menu.py} (88%) diff --git a/src/entry.py b/src/entry.py index fc7a46e..675c58e 100644 --- a/src/entry.py +++ b/src/entry.py @@ -5,6 +5,6 @@ def entry(): initialize() # import should happen after the `initialize` function is called - from src.interface.menu import menu + from src.menu import menu menu() diff --git a/src/interface/__init__.py b/src/interface/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/interface/menu.py b/src/interface/menu.py deleted file mode 100644 index 49f5a6d..0000000 --- a/src/interface/menu.py +++ /dev/null @@ -1,46 +0,0 @@ -import inquirer - - -class Choices: - RUN_SETUP_SCRIPTS = "Run setup scripts" - INSTALL_ARCH_LINUX = "Install Arch Linux" - QUIT = "Quit" - - -def menu(): - """Show menu screen.""" - - print("\n") - - questions = [ - inquirer.List( - "menu", - message="What would you like to do?", - choices=[ - Choices.RUN_SETUP_SCRIPTS, - Choices.INSTALL_ARCH_LINUX, - Choices.QUIT, - ], - ), - ] - - choice = inquirer.prompt(questions)["menu"] - - if choice == Choices.RUN_SETUP_SCRIPTS: - from src.interface.choose_action import choose_action - - choose_action() - input("\nSetup complete! (press Enter to return to menu)") - menu() - elif choice == Choices.INSTALL_ARCH_LINUX: - input("Work In Progress (press Enter to return to menu)") - menu() - elif choice == Choices.QUIT: - # return to `setup.py` so it can exit safely - return - else: - print( - """You should not have been able to reach this side of the code, -yet here you are. Consider this an easter egg.""" - ) - exit(1) diff --git a/src/interface/choose_action.py b/src/menu.py similarity index 88% rename from src/interface/choose_action.py rename to src/menu.py index 698e80e..4f7d118 100644 --- a/src/interface/choose_action.py +++ b/src/menu.py @@ -42,3 +42,12 @@ def choose_action(): print("POST INStALL TASKS:") for post_install_task in post_install_tasks: print(f"- {post_install_task}") + + +def menu(): + """Show menu screen.""" + + print("\n") + choose_action() + input("\nSetup complete! (press Enter to return to menu)") + menu()