Fixed up final bit of mypy issues

CURA-5744
This commit is contained in:
Jaime van Kessel 2018-09-21 14:12:31 +02:00
parent d0fc4878c2
commit 060ea0b762
5 changed files with 39 additions and 32 deletions

View file

@ -1,8 +1,11 @@
# Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from http.server import HTTPServer
from typing import Callable, Any, TYPE_CHECKING
from cura.OAuth2.AuthorizationHelpers import AuthorizationHelpers
if TYPE_CHECKING:
from cura.OAuth2.Models import AuthenticationResponse
from cura.OAuth2.AuthorizationHelpers import AuthorizationHelpers
class AuthorizationRequestServer(HTTPServer):
@ -14,12 +17,12 @@ class AuthorizationRequestServer(HTTPServer):
def setAuthorizationHelpers(self, authorization_helpers: "AuthorizationHelpers") -> None:
"""Set the authorization helpers instance on the request handler."""
self.RequestHandlerClass.authorization_helpers = authorization_helpers
self.RequestHandlerClass.authorization_helpers = authorization_helpers # type: ignore
def setAuthorizationCallback(self, authorization_callback) -> None:
def setAuthorizationCallback(self, authorization_callback: Callable[["AuthenticationResponse"], Any]) -> None:
"""Set the authorization callback on the request handler."""
self.RequestHandlerClass.authorization_callback = authorization_callback
self.RequestHandlerClass.authorization_callback = authorization_callback # type: ignore
def setVerificationCode(self, verification_code: str) -> None:
"""Set the verification code on the request handler."""
self.RequestHandlerClass.verification_code = verification_code
self.RequestHandlerClass.verification_code = verification_code # type: ignore