def main(): engine = create_engine("sqlite:///cinema.db") Base.metadata.create_all(engine) session = Session(bind=engine) cinema_city = Cinema(session) new_movies_and_projections_in_cinema(cinema_city) command_parser = CommandParser() command_parser.add_command("show_movies", cinema_city.show_movies) cinema_city.show_movies(session) command = input(">>>") command_parser.run_command(command)
def main(): Base.metadata.create_all(engine) arena = Cinema() while True: command = input(">>>") if command == 'add_movie': arena.add_movie() elif command == 'add_projection': arena.add_projection() elif command == 'add_reservation': arena.add_reservation() elif command == 'show_movies': arena.show_movies() elif command == 'show_movie_projections': arena.show_movie_projections(1, '2014-03-22')
def main(): engine = create_engine("sqlite:///cinema.db") base.Base.metadata.create_all(engine) session = Session(bind=engine) cinema = Cinema(session) print_menu() command = input("Enter your choice: ") put = command.split(" ") while put[0] != "end": if put[0] == "add_movie" or put[0] == '1': cinema.add_movie() if put[0] == "show_movies" or put[0] == '2': cinema.show_movies() if put[0] == "add_projection" or put[0] == '3': cinema.add_projections() if put[0] == "show_movie_projections": cinema.show_movie_projections(put[1]) if put[0] == "make_reservation" or put[0] == '5': #ENTER INFORMATION FOR USER try: #USER INFORMATION user_info = step_one(cinema) #CHOOSING MOVIE movie_choice = step_two(cinema) # CHOOSING PROJECTIONS projection_choice = step_three(cinema) # CHOOSING SEATS step_four(cinema, user_info, projection_choice, movie_choice) # FINALIZE step_five(cinema, user_info, projection_choice) except GiveUpError: print("You just give up the reservation!") print_menu() if put[0] == "cancel_reservation": cinema.cancel_reservation(put[1]) if put[0] == "exit": break if put[0] == "help": cinema.print_menu() command = input("Enter your choice: ") put = command.split(" ")
def main(): engine = create_engine("sqlite:///EmilCinema.db") Base.metadata.create_all(engine) session = Session(bind=engine) EmilCinema = Cinema(session) print_main_menu() print("asda") command = input("Enter your choice: ") parsed_command = command.split() while parsed_command[0] != "end": if parsed_command[0] == "add_movie" or parsed_command[0] == '1': EmilCinema.add_movie() if parsed_command[0] == "show_movies" or parsed_command[0] == '2': EmilCinema.show_movies() if parsed_command[0] == "add_projection" or parsed_command[0] == '3': EmilCinema.add_projection() if parsed_command[0] == "show_movie_projections" or parsed_command[0] == '4': EmilCinema.show_projections_available_spots(parsed_command[1]) if parsed_command[0] == "make_reservation" or parsed_command[0] == '5': try: user_info = personal_info(EmilCinema) movie_id = choosing_movie(EmilCinema) projection_id = choosing_projection(EmilCinema) choosing_seats(EmilCinema, user_info, projection_id, movie_id) finalize_reservation(EmilCinema, user_info, projection_id) except GiveUpError: print("You just give up the reservation!") print_main_menu() if parsed_command[0] == "cancel_reservation": EmilCinema.cancel_reservation(parsed_command[1]) if parsed_command[0] == "exit": break if parsed_command[0] == "help": EmilCinema.print_main_menu() command = input("Enter your choice: ") parsed_command = command.split()