mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 01:37:51 -06:00
Fixed up final bit of mypy issues
CURA-5744
This commit is contained in:
parent
d0fc4878c2
commit
060ea0b762
5 changed files with 39 additions and 32 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue