def ask_items_to_buy(value_tuple): try: """This function ask the user for nessasary items to display""" value_list = list(value_tuple) if value_tuple[0] == "": value_list[0] = bf.ask_item_type() if value_tuple[1] == "": value_list[1] = bf.ask_gender() if value_tuple[2] == "": value_list[2] = bf.ask_size() value_tuple_2 = tuple(value_list) return value_tuple_2 except: bf.hanprt("Sorry an error occured in asking items to buy")
def ask_items_to_remove_from_cart(value_tuple): try: """This function ask the user for removing from cart""" value_list = list(value_tuple) if value_tuple[0] == "": value_list[0] = bf.ask_item_type() if value_tuple[1] == "": value_list[1] = bf.ask_gender() if value_tuple[2] == "": value_list[2] = bf.ask_size() value_tuple_2 = tuple(value_list) return value_tuple_2 except: bf.hanprt("Sorry an error occured in asking items to buy")
def ask_entire_stock(value_tuple): """Asks the entire stocks and stores the values and asks the user for incomplete values if empty values is provided""" try: value_list = list(value_tuple) if value_tuple[0] == "": value_list[0] = bf.ask_item_type() if value_tuple[1] == "": value_list[1] = bf.ask_gender() if value_tuple[2] == "": value_list[2] = bf.ask_size() if value_tuple[3] == "": value_list[3] = bf.ask_prize() if value_tuple[4] == "": value_list[4] = bf.ask_colour() if value_tuple[5] == "": value_list[5] = bf.ask_brand() if value_tuple[6] == "": value_list[6] = bf.ask_quantity() value_tuple_2 = tuple(value_list) return value_tuple_2 except: bf.easy_center_align("Sorry an error occured in asking the stock") ask_entire_stock()
def ask_item_to_del_to_cart(value_tuple): """Asks the entire item and stores the values to cart and asks the user for incomplete values if empty values is provided""" try: value_list = list(value_tuple) #"""if value_tuple == (): return value_tuple else:""" #if value_tuple == ("", "", "", "", "", "", ""): value_tuple_2 = tuple(value_list) data_list = udb.items_available_to_remove(value_tuple_2,username) #if(len(data_list) > 1) or if len(data_list) > 1: if value_list[0] == "": value_list[0] = bf.ask_item_type() elif value_list[1] == "": value_list[1] = bf.ask_gender() elif value_list[2] == "": value_list[2] = bf.ask_size() elif value_list[4] == "": value_list[4] = bf.ask_colour() elif value_list[5] == "": value_list[5] = bf.ask_brand() elif value_list[3] == "": value_list[3] = str(bf.ask_prize()) #value_tuple_2 = tuple(value_list) #ask_item_to_add_to_cart(value_tuple_2) elif len(data_list) == 0: bf.hanprt("No such item available") """elif len(data_list) == 1: bf.hanprt("clear_cart") udb.clear_cart(username) return ()""" return () elif len(data_list) == 1: """if value_list[6] == "": value_list[6] = bf.ask_quantity()""" value_tuple_2 = tuple(value_list) return value_tuple_2 else: pass #value_tuple_2 = tuple(value_list) return value_tuple_2 value_tuple_2 = value_list return ask_item_to_del_to_cart(value_tuple_2) except : bf.hanprt("Sorry an error occured in asking you what to add to cart")