Advertisement
Guest User

Untitled

a guest
Dec 5th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1. from UI.quitUI import Goodbye
  2. from Models.airplaneData import AirplaneData
  3. from LL.mainLL import MainLL
  4.  
  5. class AirplaneMenu:
  6. def __init__(self):
  7. self.mainObject = MainLL()
  8. self.MAINMENU = """
  9. ############################################################
  10. # _|_ quit(q) #
  11. # --@--@--(_)--@--@-- #
  12. #__________________________________________________________#
  13. # #
  14. # Airplanes #
  15. # #
  16. # 1. list Airplanes #
  17. # 2. Add airplanes #
  18. # #
  19. # #
  20. # #
  21. # #
  22. # #
  23. # #
  24. # 0. Back #
  25. ############################################################
  26. """
  27. self.start()
  28.  
  29. def start(self):
  30. print(self.MAINMENU)
  31. while True:
  32. var = input("Input a command: ")
  33. if var == "1":
  34. airplanes = [str(a) for a in self.mainObject.getAirplanesLL()]
  35. for line in airplanes:
  36. print(line)
  37. input("press any key to continue.")
  38. break
  39.  
  40. elif var == "2":
  41. planeID = input("Enter airplane ID: ")
  42. types = input("Enter Airplane type: ")
  43. model = input("Enter Model name: ")
  44. capacity = input("Enter Airplane Capacity")
  45. newAirplane = AirplaneData(planeID, types,model,capacity)
  46. MainLL().addNewAirplane(newAirplane)
  47. print("New airplane saved!")
  48. input("Press any key to continue.")
  49. break
  50.  
  51. elif var == "q":
  52. Goodbye()
  53. break
  54. elif var == "0":
  55. return
  56. else:
  57. print("Invalid command")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement