def adddrinks(name, price, amount): infile = open("drinks", 'rb') inventory = pickle.load(infile) infile.close() inventory.append(Food(name, price, amount)) outfile = open("drinks", "wb") pickle.dump(inventory, outfile) outfile.close()
def addburgerIngredients(name, price, amount): infile = open("burgerIngredients", 'rb') inventory = pickle.load(infile) infile.close() inventory.append(Food(name, price, amount)) outfile = open("burgerIngredients", "wb") pickle.dump(inventory, outfile) outfile.close()
def set_drinks(self,drink,amount): found = 0 infile = open("drinks", "rb") drinks = pickle.load(infile) infile.close() for i in drinks: if(i._name == drink): self._drinks.append(Food(i._name, i._price, amount)) found = 1 break if(found == 0): print("Drink is not found")
def set_wrapIngredients(self,wrapIngredient,amount): found = 0 infile = open("wrapIngredients", "rb") wrapIngredients = pickle.load(infile) infile.close() for i in wrapIngredients: if(i._name == wrapIngredient): self._wrapIngredients.append(Food(i._name, i._price, amount)) found = 1 break if(found == 0): print("Ingredient is not found")
def set_sides(self,side,amount): found = 0 infile = open("sides", "rb") sides = pickle.load(infile) infile.close() for i in sides: if(i._name == side): self._sides.append(Food(i._name, i._price, amount)) found = 1 break if(found == 0): print("Side is not found")