Add some missing typing

This commit is contained in:
Jaime van Kessel 2020-01-10 14:25:35 +01:00
parent 3e07105edf
commit 81b33b8649
No known key found for this signature in database
GPG key ID: 3710727397403C91
18 changed files with 73 additions and 59 deletions

View file

@ -4,7 +4,7 @@
import os
import sys
import time
from typing import cast, TYPE_CHECKING, Optional, Callable, List
from typing import cast, TYPE_CHECKING, Optional, Callable, List, Any
import numpy
@ -193,7 +193,7 @@ class CuraApplication(QtApplication):
self._cura_package_manager = None
self._machine_action_manager = None
self._machine_action_manager = None # type: Optional[MachineActionManager.MachineActionManager]
self.empty_container = None # type: EmptyInstanceContainer
self.empty_definition_changes_container = None # type: EmptyInstanceContainer
@ -699,7 +699,7 @@ class CuraApplication(QtApplication):
self._message_box_callback_arguments = []
# Cura has multiple locations where instance containers need to be saved, so we need to handle this differently.
def saveSettings(self):
def saveSettings(self) -> None:
if not self.started:
# Do not do saving during application start or when data should not be saved on quit.
return
@ -989,8 +989,8 @@ class CuraApplication(QtApplication):
## Get the machine action manager
# We ignore any *args given to this, as we also register the machine manager as qml singleton.
# It wants to give this function an engine and script engine, but we don't care about that.
def getMachineActionManager(self, *args):
return self._machine_action_manager
def getMachineActionManager(self, *args: Any) -> MachineActionManager.MachineActionManager:
return cast(MachineActionManager.MachineActionManager, self._machine_action_manager)
@pyqtSlot(result = QObject)
def getMaterialManagementModel(self) -> MaterialManagementModel: