def show_stores(customer, k): print("\nFinding Closest Stores...") print("\n- CLOSEST STORES -") k_local_dominos = StoreLocator.find_k_closest_stores_to_customer( customer, k) for i, store in enumerate(k_local_dominos): print(str(i + 1) + ".") print(store) print()
def get_menu(): customer = Customer('Barack', 'Obama', '*****@*****.**', '2024561111', '40 Bay St, Toronto, ON, M5J2X2') my_local_dominos = StoreLocator.find_closest_store_to_customer(customer) if (my_local_dominos): print(my_local_dominos) menu = my_local_dominos.get_menu() return 1, menu.search(Name='Coke'), menu.search(Name='Pizza') else: return 0, [[]], [[]]
def view_menu(): print("\n- Menu Viewer -") print("\tPlease type your ADDRESS using the following form.") print("\tHOUSE #, Full Street Name, City, State/Province, ZIP/Postal Code") print("\tEXAMPLE: 700 Pennsylvania Avenue NW, Washington, DC, 20408") ret_address = ConsoleInput.get_valid_input("ADDRESS: ", ConsoleInput.validate_address) address = Address(*ret_address.split(',')) closest_store = StoreLocator.nearby_stores(address)[0] menu = closest_store.get_menu() print(menu) return
def view_stores(): print("\n- Store Locator -") print("\tPlease type your ADDRESS using the following form.") print("\tHOUSE #, Full Street Name, City, State/Province, ZIP/Postal Code") print("\tEXAMPLE: 700 Pennsylvania Avenue NW, Washington, DC, 20408") ret_address = ConsoleInput.get_valid_input("ADDRESS: ", ConsoleInput.validate_address) address = Address(*ret_address.split(',')) print("\n- CLOSEST STORES -") local_stores = StoreLocator.nearby_stores(address) for i, store in enumerate(local_stores[:5]): print(str(i + 1) + ".") print(store) print() return
from pizzapy import Customer, StoreLocator, Menu, Order, CreditCard import requests customer = Customer("Saul", "Tobias", "*****@*****.**", "7138150697", "4823 Bayou Ln, Rosharon, TX, 77583") service = 'Carryout' print(customer) try: myLocalDominos = StoreLocator.find_closest_store_to_customer(customer, service) except Exception: print("No stores open at this moment") print("Exiting Program.....") exit() print(myLocalDominos) details = myLocalDominos.get_details() print(details['ServiceHoursDescription']) #menu = myLocalDominos.get_menu() #print(menu) #menu.search(Name="Coke") #order = Order.begin_customer_order(customer, myLocalDominos) #order.add_item('P12IPAZA') #print(order)
def addToOrder(order): print("Please type the codes of the items you'd like to order...") print("Press ENTER to stop ordering.") while True: item = input("Code: ").upper() try: order.add_item(item) except: if item == "": break print("Invalid Code...") customer = ConsoleInput.get_new_customer() my_local_dominos = StoreLocator.find_closest_store_to_customer(customer) print("\nClosest Store:") print(my_local_dominos) ans = input("Would you like to order from this store? (Y/N)") if ans.lower() not in ["yes", "y"]: print("Goodbye!") quit() print("\nMENU\n") menu = my_local_dominos.get_menu() order = Order.begin_customer_order(customer, my_local_dominos) while True: searchMenu(menu)