def callFunction(complexOp, op): """ Apeleaza functia corespunzatoare optiunii op din meniu pentru obiectul de operatii ComplexOperations :param complexOp: obiect ComplexOperations :param op: string - optiunea aleasa de utilizator """ currentMenu = Menu.get_currentMenu() if Menu.user_exits(op): Menu.navigate_backwards() menuFunctions = currentMenu.get_menuFunctions() if op in menuFunctions: currentMenu.get_functionAt(menuFunctions, op)(complexOp)
def get_next_action(complexOp, op): """ Preia optiunea de la utilizator si apeleaza functia corespunzatoare sau navigheaza in submeniul corespunzator :param complexOp: obiect ComplexOperations """ currentMenu = Menu.get_currentMenu() if Menu.user_exits(op): Menu.navigate_backwards() return currentSubMenus = currentMenu.get_subMenus() if currentSubMenus is not None: if op in currentSubMenus.keys(): # navigate to submenu Menu.navigate_to_submenu(op) return callFunction(complexOp, op)
def isOption(op): currentMenu = Menu.get_currentMenu() options = list(currentMenu.get_menuItems().keys()) if op not in options: return False return True
def display_menu(): """ Afiseaza meniul curent """ currentMenu = Menu.get_currentMenu() currentMenu.print_menu()