Beispiel #1
0
def search_as_login(city,area):
    try:
       
        list_of_restaurants=Validate.validate_search_category(city,area)
        
        print("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
        print("resturantname     type of food    likes     dislikes     rating")
        for select in list_of_restaurants:
            print(select.get_restaurantname(),"     ",select.get_type_of_food()," " ,  select.get_likes(),"     ",select.get_dislikes(),"     ",select.get_rating())
        print()   
        
        
        choice=input("Do you want to filter or select restaurant?(F/S)")
        if (choice=="F"):
            
            filtersearch.Filter_search()
            
            
        if (choice=="S"):
            resturant_name=input("Enter the resturant name:")  
            print("")  
    
    except InvalidCategoryException as e:
        print(e)
    except Exception as e:
        print("here is")
        print("Sorry. Some system error occurred")
        print(e)
    print()    
    
Beispiel #2
0
def search_as_guest():

    try:
        FoodModule.Food.is_registered_user = False
        city1 = input("Enter your city:")
        area1 = input("Enter your area:")
        city = city1.upper()
        area = area1.upper()

        list_of_restaurants = Validate.validate_search_category(city, area)
        '''
        Print the details
         '''
        print("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
        print(
            "resturantname     type of food    likes     dislikes     rating")
        for select in list_of_restaurants:
            print(select.get_restaurantname(), "     ",
                  select.get_type_of_food(), " ", select.get_likes(), "     ",
                  select.get_dislikes(), "     ", select.get_rating())
        print()

        filter(city, area)

    except CustomException2.Invalidcityareaname as e:
        print(e)
    except Exception as e:
        print(e)
        print()
def search_as_guest():
    try:
        city = input("Enter your city:")
        area = input("Enter your area:")

        #         city=city1.upper()
        #         area=area1.upper()
        list_of_restaurants = Validate.validate_search_category(city, area)
        '''
        Print the details
         '''
        print("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
        print(
            "resturantname     type of food    likes     dislikes     rating")
        for select in list_of_restaurants:
            print(select.get_restaurantname(), "     ",
                  select.get_type_of_food(), " ", select.get_likes(), "     ",
                  select.get_dislikes(), "     ", select.get_rating())
        print()

        choice = input("Do you want to filter or select restaurant?(F/S)")
        try:
            if (choice.upper() == "F"):

                filtersearch.Filter_search(city, area)
        except CustomException2.Invalidfilter as e:
            print(e)
        except Exception as e:
            print("Choose F or S")
            print(e)

        if (choice.upper() == "S"):
            resturant_name = input("Enter the resturant name:")
            print("")

    except CustomException2.InvalidCategoryException as e:
        print(e)
    except Exception as e:
        print(e)
    print()
Beispiel #4
0
def search_as_login(city1, area1):
    try:
        city = city1.upper()
        area = area1.upper()
        list_of_restaurants = Validate.validate_search_category(city, area)

        print("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
        print(
            "resturantname     type of food    likes     dislikes     rating")
        for select in list_of_restaurants:
            print(select.get_restaurantname(), "     ",
                  select.get_type_of_food(), " ", select.get_likes(), "     ",
                  select.get_dislikes(), "     ", select.get_rating())
        print()

        filter(city, area)

    except CustomException2.InvalidCategoryException as e:
        print(e)
    except Exception as e:
        print("Sorry. Some system error occurred")
        print(e)
    print()