def notify(self, event_in): """ Receive events posted to the message queue. """ if isinstance(event_in, Start): self.initialize() elif isinstance(event_in, ChangeState): self.tickcounter = 0 elif isinstance(event_in, EndGame): # shut down the pygame graphics self.isinitialized = False pygame.quit() elif isinstance(event_in, Tick) or isinstance( event_in, Keyboard) or isinstance( event_in, KeyboardUp) or isinstance(event_in, Mouse): currentstate = self.model.statem.peek() if currentstate == STATE_TEST: testing.testing(event_in, self) if currentstate == STATE_INTRO1: menu.allopperational(self) if currentstate == HOMESCREEN: menu.home(self, event_in) if currentstate == LOGIN: menu.login(self, event_in) if currentstate == PLAYGAME: self.evManager.post(ChangeState(LOAD_LEVEL1)) if currentstate == ENDGAME: menu.endgame(self, event_in) if currentstate > 200: gameplay.loadlevel(self, currentstate - 200) if 99 < currentstate < 200: gameplay.level(self, event_in)
def main_menu(): while True: print('\n1. Create an account\n2. Log into account\n3. Show all accounts\n0. Exit') choice = input() if choice == '1': cd.create_card() continue elif choice == '2': loggedin = mn.login(cd.check_card()) if loggedin: continue else: stop() break elif choice == '3': db.show_details() elif choice == '0': stop() break
def main(): permissao = 'no_permission' while True: login.carrega_credenciais() ADMIN = 'admin' VENDEDOR = 'vendedor' credenciais = menu.login() permissao = credencia(login.get_cred_adm(), credenciais, ADMIN) if permissao != ADMIN: permissao = credencia(login.get_cred_prolet(), credenciais, VENDEDOR) if permissao == 'no_permission': print( '\33[1;31mERRO: Login ou senha inválidos, tente novamente\33[m' ) time.sleep(2)
def main(): name_user, last_name_user = menu.login() menu.printMenu() getCommand(name_user, last_name_user)