def registerForm(): form = RegisterForm() form.fillTheForm() Common.clearTerminal() if form.validation(): response = Connection.registerRequest(form.getData()) successful = response.get("successful") message = response.get("message") if successful: Common.printPositiveText(message) else: Common.printNegativeText(message) else: Common.printNegativeText(form.getValidationMessage()) Common.programSleep()
def loginForm(): form = LoginForm() form.fillTheForm() Common.clearTerminal() if form.validation(): response = Connection.loginRequest(form.getData()) successful = response.get("successful") message = response.get("message") if successful: Common.printPositiveText(message) Common.programSleep() LobbyView.view() else: Common.printNegativeText(message) else: Common.printNegativeText(form.getValidationMessage()) Common.programSleep()