mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-08 22:35:03 -06:00
Modernize typing usage
Some boyscouting.
This commit is contained in:
parent
677b64f068
commit
70504f1b04
3 changed files with 11 additions and 11 deletions
|
@ -74,14 +74,14 @@ class Account(QObject):
|
|||
self._application = application
|
||||
self._new_cloud_printers_detected = False
|
||||
|
||||
self._error_message = None # type: Optional[Message]
|
||||
self._error_message: Optional[Message] = None
|
||||
self._logged_in = False
|
||||
self._user_profile = None # type: Optional[UserProfile]
|
||||
self._user_profile: Optional[UserProfile] = None
|
||||
self._additional_rights: Dict[str, Any] = {}
|
||||
self._sync_state = SyncState.IDLE
|
||||
self._manual_sync_enabled = False
|
||||
self._update_packages_enabled = False
|
||||
self._update_packages_action = None # type: Optional[Callable]
|
||||
self._update_packages_action: Optional[Callable] = None
|
||||
self._last_sync_str = "-"
|
||||
|
||||
self._callback_port = 32118
|
||||
|
@ -107,7 +107,7 @@ class Account(QObject):
|
|||
self._update_timer.setSingleShot(True)
|
||||
self._update_timer.timeout.connect(self.sync)
|
||||
|
||||
self._sync_services = {} # type: Dict[str, int]
|
||||
self._sync_services: Dict[str, int] = {}
|
||||
"""contains entries "service_name" : SyncState"""
|
||||
|
||||
def initialize(self) -> None:
|
||||
|
|
|
@ -25,11 +25,11 @@ class AuthorizationRequestHandler(BaseHTTPRequestHandler):
|
|||
super().__init__(request, client_address, server)
|
||||
|
||||
# These values will be injected by the HTTPServer that this handler belongs to.
|
||||
self.authorization_helpers = None # type: Optional[AuthorizationHelpers]
|
||||
self.authorization_callback = None # type: Optional[Callable[[AuthenticationResponse], None]]
|
||||
self.verification_code = None # type: Optional[str]
|
||||
self.authorization_helpers: Optional[AuthorizationHelpers] = None
|
||||
self.authorization_callback: Optional[Callable[[AuthenticationResponse], None]] = None
|
||||
self.verification_code: Optional[str] = None
|
||||
|
||||
self.state = None # type: Optional[str]
|
||||
self.state: Optional[str] = None
|
||||
|
||||
# CURA-6609: Some browser seems to issue a HEAD instead of GET request as the callback.
|
||||
def do_HEAD(self) -> None:
|
||||
|
|
|
@ -42,13 +42,13 @@ class AuthorizationService:
|
|||
self._settings = settings
|
||||
self._auth_helpers = AuthorizationHelpers(settings)
|
||||
self._auth_url = "{}/authorize".format(self._settings.OAUTH_SERVER_URL)
|
||||
self._auth_data = None # type: Optional[AuthenticationResponse]
|
||||
self._user_profile = None # type: Optional["UserProfile"]
|
||||
self._auth_data: Optional[AuthenticationResponse] = None
|
||||
self._user_profile: Optional["UserProfile"] = None
|
||||
self._preferences = preferences
|
||||
self._server = LocalAuthorizationServer(self._auth_helpers, self._onAuthStateChanged, daemon=True)
|
||||
self._currently_refreshing_token = False # Whether we are currently in the process of refreshing auth. Don't make new requests while busy.
|
||||
|
||||
self._unable_to_get_data_message = None # type: Optional[Message]
|
||||
self._unable_to_get_data_message: Optional[Message] = None
|
||||
|
||||
self.onAuthStateChanged.connect(self._authChanged)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue