pytwitcherapi.oauth.LoginServer¶
-
class
pytwitcherapi.oauth.LoginServer(session)[source]¶ Bases:
BaseHTTPServer.HTTPServerThis server responds to the redirection of the user after he granted authorization.
-
__init__(session)[source]¶ Initialize a new server.
The server will be on
constants.LOGIN_SERVER_ADRESS.Parameters: session ( requests_oauthlib.OAuth2Session) – the session that needs a tokenRaises: None
Methods
__init__(session)Initialize a new server. close_request(request)Called to clean up an individual request. fileno()Return socket file number. finish_request(request, client_address)Finish one request by instantiating RequestHandlerClass. get_request()Get the request and client address from the socket. handle_error(request, client_address)Handle an error gracefully. handle_request()Handle one request, possibly blocking. handle_timeout()Called if no new request arrives within self.timeout. process_request(request, client_address)Call finish_request. serve_forever([poll_interval])Handle one request at a time until shutdown. server_activate()Called by constructor to activate the server. server_bind()Override server_bind to store the server name. server_close()Called to clean-up the server. set_token(redirecturl)Set the token on the session shutdown()Stops the serve_forever loop. shutdown_request(request)Called to shutdown and close an individual request. verify_request(request, client_address)Verify the request. Attributes
address_familyallow_reuse_addressrequest_queue_sizesocket_typetimeout-
session= None¶ The session that needs a token
-