def main(): db_initialize() # basic menu I think, I'm not sure if I should've put validation here or elsewhere. menu_selection = '' while menu_selection.lower() != 'q': menu_selection = ui.display_menu() if menu_selection == '1': # selection 1 goes to the UI to get info from the user # then puts those together to add the artist, taking the response # and sending it to be displayed. artist_name = ui.get_artist_name() artist_email = ui.get_artist_email() response = add_artist((artist_name, artist_email)) ui.message(response) elif menu_selection == '2': # adding artwork does much the same, requests info and then attemps to add # if it's successful, the response gives an ok. artwork_data = ui.get_artwork_info() response = add_artwork(artwork_data) ui.message(response) elif menu_selection == '3': data = select_artists() ui.display_artists(data) elif menu_selection == '4': artist_id = ui.get_artist_id() data = select_artworks(artist_id) ui.display_artworks(data) # elif menu_selection == '5': ui.quit()
def main(): db_store.db_setup() quit = 'q' choice = None while choice != quit: choice = ui.display_menu() handle_menu_choice(choice)
def main(): ui.message("\nWelcome to Fun Night Out!") quit = "q" choice = None # main menu display loop while choice != quit: choice = ui.display_menu() handle_choice(choice)
def main(): log.write_to_log("Main function executed.") ui.print_to_user("\nWelcome to Fun Night Out!") quit = "q" choice = None # main menu display loop while choice != quit: choice = ui.display_menu() handle_choice(choice)
def main(): choice = None #delete_juggler_table() #merchandising_DB.delete_table() merchandising_DB.create_merchandise_table() merchandising_DB.create_events_table() merchandising_DB.create_event_sales_table() while choice != '6': choice = ui.display_menu() use_choice(choice)
def display_menu(): menu_commands = [ 'Dodaj nowa notatke', 'Wyswietl wszystkie notatki', 'Pokaz wybrane notatki', 'Usun notatke', 'Ilosc notatek', 'QUIT' ] ui.display_menu(menu_commands)