Esempio n. 1
0
def person_option(people, teams, drinks):
    if check_empty(teams):
        print("Add a team option first")
        return

    if check_empty(drinks):
        print("Add a drink option first")
        return

    print("Adding new Person...")
    # Get details
    f_name = ui.get_string_input("What is their first name? $")
    l_name = ui.get_string_input("What is their surname? $")

    # Add team?
    print("Select team: (Add team on main menu if it doesn't exist)")
    team_index = choose_option_from_list(teams)
    if team_index == -1:
        return

    team = teams[team_index]

    # Add Favourite Drink
    print("Select Drink: (Add drink on main menu if it doesn't exist)")
    drink_index = choose_option_from_list(drinks)
    if drink_index == -1:
        return

    pref = drinks[drink_index]

    add_person(f_name, l_name, pref, team, people)
    print(f"{f_name.capitalize()} added!!")
Esempio n. 2
0
def team_option(teams):
    print("Adding new team...")
    team_name = ui.get_string_input("Enter team name $")
    team_location = ui.get_string_input("Enter location $")

    add_team(team_name, team_location, teams)
Esempio n. 3
0
def drink_option(drinks):
    print("Adding new drink...")
    drink_name = ui.get_string_input("Enter drink name $")

    add_drink(drink_name, drinks)