CURA-5330 Add typing in QualityGroup

This commit is contained in:
Diego Prado Gesto 2018-06-08 15:46:24 +02:00
parent e5e96bc600
commit e1ecbdf8fe

View File

@ -1,7 +1,7 @@
# Copyright (c) 2018 Ultimaker B.V. # Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher. # Cura is released under the terms of the LGPLv3 or higher.
from typing import Dict, Optional, List from typing import Dict, Optional, List, Set
from PyQt5.QtCore import QObject, pyqtSlot from PyQt5.QtCore import QObject, pyqtSlot
@ -21,7 +21,7 @@ from PyQt5.QtCore import QObject, pyqtSlot
# #
class QualityGroup(QObject): class QualityGroup(QObject):
def __init__(self, name: str, quality_type: str, parent = None): def __init__(self, name: str, quality_type: str, parent = None) -> None:
super().__init__(parent) super().__init__(parent)
self.name = name self.name = name
self.node_for_global = None # type: Optional["QualityGroup"] self.node_for_global = None # type: Optional["QualityGroup"]
@ -33,8 +33,8 @@ class QualityGroup(QObject):
def getName(self) -> str: def getName(self) -> str:
return self.name return self.name
def getAllKeys(self) -> set: def getAllKeys(self) -> Set[str]:
result = set() result = set() #type: Set[str]
for node in [self.node_for_global] + list(self.nodes_for_extruders.values()): for node in [self.node_for_global] + list(self.nodes_for_extruders.values()):
if node is None: if node is None:
continue continue