def setPassword(self): if self.ui.username.text() and self.ui.token.text() and self.ui.password.text(): try: setNewPassword(self.ui.token.text(), self.ui.username.text(), self.ui.password.text()) self.ui.setPassword.setText("New password set") except HTTPError as error: messageBox = QtGui.QMessageBox(parent=self, text="An error occurred " + str(error)) messageBox.show() else: messageBox = QtGui.QMessageBox(parent=self, text="Fill all fields") messageBox.show()
delRandom(1, 2, messageList12, MESSAGES_1TO2, MESSAGES_2TO1, s1, s2, USER1, USER2) delRandom(1, 3, messageList13, MESSAGES_1TO3, MESSAGES_3TO1, s1, s3, USER1, USER3) delRandom(2, 3, messageList23, MESSAGES_2TO3, MESSAGES_3TO2, s2, s3, USER2, USER3) print("OK") print("Trying password recovery") print("Requesting") requestRecovery(USER1, MAIL1) requestRecovery(USER2, MAIL2) requestRecovery(USER3, MAIL3) print("Ok") recovered = False while not recovered: try: token1 = input("Insert token you received for "+USER1+": ") setNewPassword(token1, USER1, "tpass1") recovered = True except HTTPError as error: print("FAIL -", error) recovered = False recovered = False while not recovered: try: token2 = input("Insert token you received for "+USER2+": ") setNewPassword(token2, USER2, "tpass2") recovered = True except HTTPError as error: print("FAIL -", error) recovered = False recovered = False while not recovered: