Use modern python typing

CURA-9278
This commit is contained in:
c.lamboo 2022-09-12 17:04:40 +02:00
parent 96bc5ed602
commit 8d9e9a9dbf
2 changed files with 5 additions and 5 deletions

View file

@ -13,9 +13,9 @@ class ExtruderConfigurationModel(QObject):
def __init__(self, position: int = -1) -> None: def __init__(self, position: int = -1) -> None:
super().__init__() super().__init__()
self._position = position # type: int self._position: int = position
self._material = None # type: Optional[MaterialOutputModel] self._material: Optional[MaterialOutputModel] = None
self._hotend_id = None # type: Optional[str] self._hotend_id: Optional[str] = None
def setPosition(self, position: int) -> None: def setPosition(self, position: int) -> None:
self._position = position self._position = position

View file

@ -99,7 +99,7 @@ class MachineManager(QObject):
self._application.getPreferences().addPreference("cura/active_machine", "") self._application.getPreferences().addPreference("cura/active_machine", "")
self._printer_output_devices = [] # type: List[PrinterOutputDevice] self._printer_output_devices: List[PrinterOutputDevice] = []
self._application.getOutputDeviceManager().outputDevicesChanged.connect(self._onOutputDevicesChanged) self._application.getOutputDeviceManager().outputDevicesChanged.connect(self._onOutputDevicesChanged)
# There might already be some output devices by the time the signal is connected # There might already be some output devices by the time the signal is connected
self._onOutputDevicesChanged() self._onOutputDevicesChanged()
@ -112,7 +112,7 @@ class MachineManager(QObject):
self._application.callLater(self.setInitialActiveMachine) self._application.callLater(self.setInitialActiveMachine)
containers = CuraContainerRegistry.getInstance().findInstanceContainers(id = self.activeMaterialId) # type: List[InstanceContainer] containers: List[InstanceContainer] = CuraContainerRegistry.getInstance().findInstanceContainers(id = self.activeMaterialId)
if containers: if containers:
containers[0].nameChanged.connect(self._onMaterialNameChanged) containers[0].nameChanged.connect(self._onMaterialNameChanged)