# ----------------------------------------------------------------------- def request(self, url, args = None): '''Make an authenticated request to the given URL. If no access token is currently set, an exception will be thrown.

# ----------------------------------------------------------------------- def get_access_token(self): """Get the access token in use by this OAuth 2.0 client, so that it can be persisted."""

return self._access_token

# --------------------------------------------------------------------------- class OAuthCodeHandler(HTTPServer): """Handles the response from an OAuth2 handler and allows the retrieval of the code."""

# ----------------------------------------------------------------------- def __init__(self, success_response = '<h1>Success</h1><p>Please now close this window.</p>', failure_response = '<h1>Failed</h1><p>%s</p>'): '''Create a new handler, with optional overrides of the success and failure response messages.'''