def iniciar(self): opts = [self.cadastrar, self.verCarros] optsString = ['Cadastrar carro', 'Ver carros'] while True: opt = GeneralView.menu(optsString) if opt is None or opt >= len(opts): break else: opts[opt]()
def iniciar(self): opts = [self.alugarCarro, self.verAlugueis] optsString = ['Alugar carro', 'Ver alguéis'] while True: opt = GeneralView.menu(optsString) if opt is None or opt >= len(opts): break else: opts[opt]()
def iniciar(self): opts = [ self.carController, self.userController, self.aluguelController ] optsString = ['Carros', 'Usuários', 'Aluguéis'] while True: opt = GeneralView.menu(optsString, voltar='Sair') if opt is None or opt >= len(opts): GeneralView.message('Adeus') break else: opts[opt]()