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)