def clear_token(self, app_name, callback=NO_OP, errback=NO_OP): """Clear the token for an application from the keyring. 'app_name' is the name of the application. """ d = Credentials(app_name=app_name).clear_credentials() # pylint: disable=E1101 d.addCallbacks(lambda _: callback(), errback)
def find_credentials(self, app_name, callback=NO_OP, errback=NO_OP): """Get the credentials from the keyring or {} if not there.""" def log_result(result): """Log the result and continue.""" logger.info('find_credentials: app_name "%s", result is {}? %s', app_name, result == {}) return result d = Credentials(app_name=app_name).find_credentials() # pylint: disable=E1101 d.addCallback(log_result) d.addCallbacks(callback, errback)