add menu UI
This commit is contained in:
parent
8ce51b7872
commit
ea70323638
2 changed files with 47 additions and 2 deletions
|
@ -5,6 +5,6 @@ def entry():
|
|||
initialize()
|
||||
|
||||
# import should happen after the `initialize` function is called
|
||||
from src.interface.choose_action import choose_action
|
||||
from src.interface.menu import menu
|
||||
|
||||
choose_action()
|
||||
menu()
|
||||
|
|
45
src/interface/menu.py
Normal file
45
src/interface/menu.py
Normal file
|
@ -0,0 +1,45 @@
|
|||
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:
|
||||
exit(0)
|
||||
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)
|
Loading…
Add table
Add a link
Reference in a new issue