mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Add typings and fix code style
This commit is contained in:
parent
53d083e232
commit
4cc1b6ce02
9 changed files with 61 additions and 39 deletions
|
@ -11,7 +11,7 @@ class ExtruderConfigurationModel(QObject):
|
|||
|
||||
extruderConfigurationChanged = pyqtSignal()
|
||||
|
||||
def __init__(self, position: int = -1):
|
||||
def __init__(self, position: int = -1) -> None:
|
||||
super().__init__()
|
||||
self._position = position # type: int
|
||||
self._material = None # type: Optional[MaterialOutputModel]
|
||||
|
@ -24,17 +24,17 @@ class ExtruderConfigurationModel(QObject):
|
|||
def position(self) -> int:
|
||||
return self._position
|
||||
|
||||
def setMaterial(self, material: Optional[MaterialOutputModel]):
|
||||
def setMaterial(self, material: Optional[MaterialOutputModel]) -> None:
|
||||
if self._hotend_id != material:
|
||||
self._material = material
|
||||
self.extruderConfigurationChanged.emit()
|
||||
|
||||
@pyqtProperty(QObject, fset = setMaterial, notify = extruderConfigurationChanged)
|
||||
def activeMaterial(self) -> MaterialOutputModel:
|
||||
def activeMaterial(self) -> Optional[MaterialOutputModel]:
|
||||
return self._material
|
||||
|
||||
@pyqtProperty(QObject, fset=setMaterial, notify=extruderConfigurationChanged)
|
||||
def material(self) -> MaterialOutputModel:
|
||||
def material(self) -> Optional[MaterialOutputModel]:
|
||||
return self._material
|
||||
|
||||
def setHotendID(self, hotend_id: Optional[str]) -> None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue