def __slot_validate_secret(self,secret): try: utilities.assert_valid_secret(str(secret)) self.__set_status('Secret is valid.') except Exception as e: self.__disable_ok('Invalid secret. %s' % e) return 1
def __slot_validate_credentials(self): key = str(self.__ui.lineEditKey.text()) secret = str(self.__ui.lineEditSecret.text()) # empty credentials are allowed if key == '' and secret == '': self.__enable_ok() return try: utilities.assert_valid_key(key) except Exception as e: self.__disable_ok('Invalid key.'.format(str(e))) return try: utilities.assert_valid_secret(secret) except Exception as e: self.__disable_ok('Invalid secret.'.format(str(e))) return self.__enable_ok()