class Information_controller(object): def __init__(self): self.__information_menu = Print_information() self.info_service = Information_service() self.__get_format = Format_text() self.menu = "" def information_page(self): choice = "" while choice != "p": self.menu = self.__get_format.info_format() choice = self.__information_menu.information_main_page(self.menu) if choice == "a": self.__information_menu.car_rental_agreement() input("Press enter to continue.") elif choice == "b": self.__information_menu.terms_and_conditions() input("Press enter to continue.") elif choice == "c": self.__information_menu.quality_policy() input("Press enter to continue.") elif choice == "d": salesman_dict = self.info_service.get_salesman_dict() self.__information_menu.print_salesman_header() for ID, salesman in salesman_dict.items(): name = salesman.get_name() email = salesman.get_email() self.__information_menu.print_salesman(name, email, ID) input("Press enter to continue.")
class Information_controller: def __init__(self): #Services self.info_service = Information_service() #UIs self.__information_menu = Print_information() #Utilizations self.__get_format = Format_text() #Variables self.menu = "" def information_page(self): """Reads choice and directs to right path depending on input""" choice = "" while choice not in ["p", "m"]: self.menu = self.__get_format.info_format() choice = self.__information_menu.information_main_page(self.menu) #Rental Agreement if choice == "1": self.__information_menu.car_rental_agreement() input("\nPress enter to continue.") #Terms and conditions elif choice == "2": self.__information_menu.terms_and_conditions() input("\nPress enter to continue.") #Quality Policy elif choice == "3": self.__information_menu.quality_policy() input("\nPress enter to continue.") #Uses salesman dict to return a dict of salesmen elif choice == "4": salesman_dict = self.info_service.get_salesman_dict() self.__information_menu.print_salesman_header() for ID, salesman in salesman_dict.items(): name = salesman.get_name() email = salesman.get_email() self.__information_menu.print_salesman(name, email, ID) input("\nPress enter to continue.") elif choice == "x": exit()