main_menu.py
MainMenu
¶
First view displayed, main menu.
__init__(self)
special
¶
Constructor for MainMenu.
Source code in views/main_menu.py
def __init__(self):
"""Constructor for MainMenu."""
_HELPER.print_title("menu principal")
self.print_menu()
self.user_selection()
print_menu(self)
¶
Displays the different menu options.
Source code in views/main_menu.py
def print_menu(self):
"""Displays the different menu options."""
number = typer.style("1. ", bold=True)
typer.echo(number + "Tournois")
number = typer.style("2. ", bold=True)
typer.echo(number + "Gérer les joueurs")
number = typer.style("3. ", bold=True)
typer.echo(number + "Générer un rapport")
number = typer.style("\n0. ", bold=True)
typer.echo(number + "Quitter")
user_selection(self)
¶
Prompts the user to select an option.
Source code in views/main_menu.py
def user_selection(self):
"""Prompts the user to select an option."""
selection = typer.prompt("\nEntrez votre sélection: ")
typer.echo("\n")
if selection == "0":
typer.Exit()
elif selection == "1":
TournamentMenu()
elif selection == "2":
PlayerMenu()
elif selection == "3":
ReportMenu()
else:
self.user_selection()