Beispiel #1
0
def view_rounds(rounds, people, drinks):
    ui.print_table("Rounds", rounds)
    if len(rounds) == 0:
        return
    print("Would you like to see details of a round?")
    user_choice = choose_option_from_list(rounds)
    if user_choice == -1:
        return
    round_details(rounds[user_choice], people, drinks)
Beispiel #2
0
def round_details(round, people, drinks):
    os.system("clear")
    print(round)
    ui.print_table("Orders", round.orders)
    print("Options:")
    print("\t1. Add to Order")
    print("\t2. Mark Completed")
    print("\t3. Change Maker")
    print("\t0. Return")
    menu_option = ui.get_int_input(3)

    if menu_option == 1:
        add_order_to_round(round, people, drinks)
    if menu_option == 2:
        round.finish_round()
    if menu_option == 3:
        print("Not implemented")
    if menu_option == 0:
        return
Beispiel #3
0
def view_teams(teams):
    ui.print_table("Teams", teams)
Beispiel #4
0
def view_drinks(drinks):
    ui.print_table("Drinks", drinks)
Beispiel #5
0
def view_people(people):
    ui.print_table("People", people)
Beispiel #6
0
def view_completed_rounds(completed_rounds):
    ui.print_table("Old Rounds", completed_rounds)
Beispiel #7
0
if __name__ == "__main__":

    arguments = sys.argv

    # Loading data to file
    people = fm.load_file_to_data("people")
    drinks = fm.load_file_to_data("drinks")
    rounds = fm.load_file_to_data("rounds")
    teams = fm.load_file_to_data("teams")
    completed_rounds = fm.load_file_to_data("completed_rounds")

    # If running as command line argument
    if len(arguments) > 1:

        if "get-people" in arguments:
            ui.print_table("People", people)
            exit()

        if "get-drinks" in arguments:
            ui.print_table("Drinks", drinks)
            exit()

        if "get-teams" in arguments:
            ui.print_table("Teams", teams)
            exit()

        if "get-rounds" in arguments:
            ui.print_table("Rounds", rounds)
            exit()

        if "nuke-data" in arguments: