diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index e47659a7c1..ed211ed7b4 100755 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -770,7 +770,7 @@ class BuildVolume(SceneNode): self._has_errors = len(self._error_areas) > 0 - self._disallowed_areas = [] # type: List[Polygon] + self._disallowed_areas = [] for extruder_id in result_areas: self._disallowed_areas.extend(result_areas[extruder_id]) self._disallowed_areas_no_brim = [] diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 5b1f9a0fce..bf745b1db3 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -421,7 +421,7 @@ class CuraApplication(QtApplication): # Add empty variant, material and quality containers. # Since they are empty, they should never be serialized and instead just programmatically created. # We need them to simplify the switching between materials. - self.empty_container = cura.Settings.cura_empty_instance_containers.empty_container # type: EmptyInstanceContainer + self.empty_container = cura.Settings.cura_empty_instance_containers.empty_container self._container_registry.addContainer( cura.Settings.cura_empty_instance_containers.empty_definition_changes_container) diff --git a/cura/Machines/MaterialManager.py b/cura/Machines/MaterialManager.py index 2163cde623..90012325c8 100644 --- a/cura/Machines/MaterialManager.py +++ b/cura/Machines/MaterialManager.py @@ -93,7 +93,7 @@ class MaterialManager(QObject): self._container_registry.findContainersMetadata(type = "material") if metadata.get("GUID")} # type: Dict[str, Dict[str, Any]] - self._material_group_map = dict() # type: Dict[str, MaterialGroup] + self._material_group_map = dict() # Map #1 # root_material_id -> MaterialGroup @@ -120,7 +120,7 @@ class MaterialManager(QObject): # Map #1.5 # GUID -> material group list - self._guid_material_groups_map = defaultdict(list) # type: Dict[str, List[MaterialGroup]] + self._guid_material_groups_map = defaultdict(list) for root_material_id, material_group in self._material_group_map.items(): guid = material_group.root_material_node.getMetaDataEntry("GUID", "") self._guid_material_groups_map[guid].append(material_group) @@ -202,7 +202,7 @@ class MaterialManager(QObject): # Map #4 # "machine" -> "nozzle name" -> "buildplate name" -> "root material ID" -> specific material InstanceContainer - self._diameter_machine_nozzle_buildplate_material_map = dict() # type: Dict[str, Dict[str, MaterialNode]] + self._diameter_machine_nozzle_buildplate_material_map = dict() for material_metadata in material_metadatas.values(): self.__addMaterialMetadataIntoLookupTree(material_metadata) diff --git a/cura/PrinterOutput/GenericOutputController.py b/cura/PrinterOutput/GenericOutputController.py index e770fc79a1..c160459776 100644 --- a/cura/PrinterOutput/GenericOutputController.py +++ b/cura/PrinterOutput/GenericOutputController.py @@ -55,7 +55,7 @@ class GenericOutputController(PrinterOutputController): self._preheat_hotends_timer.stop() for extruder in self._preheat_hotends: extruder.updateIsPreheating(False) - self._preheat_hotends = set() # type: Set[ExtruderOutputModel] + self._preheat_hotends = set() def moveHead(self, printer: "PrinterOutputModel", x, y, z, speed) -> None: self._output_device.sendCommand("G91") @@ -159,7 +159,7 @@ class GenericOutputController(PrinterOutputController): def _onPreheatHotendsTimerFinished(self) -> None: for extruder in self._preheat_hotends: self.setTargetHotendTemperature(extruder.getPrinter(), extruder.getPosition(), 0) - self._preheat_hotends = set() #type: Set[ExtruderOutputModel] + self._preheat_hotends = set() # Cancel any ongoing preheating timers, without setting back the temperature to 0 # This can be used eg at the start of a print @@ -167,7 +167,7 @@ class GenericOutputController(PrinterOutputController): if self._preheat_hotends_timer.isActive(): for extruder in self._preheat_hotends: extruder.updateIsPreheating(False) - self._preheat_hotends = set() #type: Set[ExtruderOutputModel] + self._preheat_hotends = set() self._preheat_hotends_timer.stop() diff --git a/cura/Settings/ExtruderManager.py b/cura/Settings/ExtruderManager.py index acf07c6b6c..60849f0dd9 100755 --- a/cura/Settings/ExtruderManager.py +++ b/cura/Settings/ExtruderManager.py @@ -132,7 +132,7 @@ class ExtruderManager(QObject): elif current_extruder_trains: object_extruders.add(current_extruder_trains[0].getId()) - self._selected_object_extruders = list(object_extruders) # type: List[Union[str, "ExtruderStack"]] + self._selected_object_extruders = list(object_extruders) return self._selected_object_extruders @@ -141,7 +141,7 @@ class ExtruderManager(QObject): # This will trigger a recalculation of the extruders used for the # selection. def resetSelectedObjectExtruders(self) -> None: - self._selected_object_extruders = [] # type: List[Union[str, "ExtruderStack"]] + self._selected_object_extruders = [] self.selectedObjectExtrudersChanged.emit() @pyqtSlot(result = QObject) diff --git a/plugins/SimulationView/SimulationView.py b/plugins/SimulationView/SimulationView.py index 3b2db2efac..18f436b13a 100644 --- a/plugins/SimulationView/SimulationView.py +++ b/plugins/SimulationView/SimulationView.py @@ -572,14 +572,14 @@ class SimulationView(CuraView): self._current_layer_jumps = job.getResult().get("jumps") self._controller.getScene().sceneChanged.emit(self._controller.getScene().getRoot()) - self._top_layers_job = None # type: Optional["_CreateTopLayersJob"] + self._top_layers_job = None def _updateWithPreferences(self) -> None: self._solid_layers = int(Application.getInstance().getPreferences().getValue("view/top_layer_count")) self._only_show_top_layers = bool(Application.getInstance().getPreferences().getValue("view/only_show_top_layers")) self._compatibility_mode = self._evaluateCompatibilityMode() - self.setSimulationViewType(int(float(Application.getInstance().getPreferences().getValue("layerview/layer_view_type")))); + self.setSimulationViewType(int(float(Application.getInstance().getPreferences().getValue("layerview/layer_view_type")))) for extruder_nr, extruder_opacity in enumerate(Application.getInstance().getPreferences().getValue("layerview/extruder_opacities").split("|")): try: diff --git a/plugins/XmlMaterialProfile/XmlMaterialProfile.py b/plugins/XmlMaterialProfile/XmlMaterialProfile.py index 10a3a09c68..8d0177c165 100644 --- a/plugins/XmlMaterialProfile/XmlMaterialProfile.py +++ b/plugins/XmlMaterialProfile/XmlMaterialProfile.py @@ -969,7 +969,7 @@ class XmlMaterialProfile(InstanceContainer): machine_compatibility = cls._parseCompatibleValue(entry.text) for identifier in machine.iterfind("./um:machine_identifier", cls.__namespaces): - machine_id_list = product_id_map.get(identifier.get("product"), []) + machine_id_list = product_id_map.get(identifier.get("product", ""), []) if not machine_id_list: machine_id_list = cls.getPossibleDefinitionIDsFromName(identifier.get("product")) @@ -1001,7 +1001,7 @@ class XmlMaterialProfile(InstanceContainer): result_metadata.append(new_material_metadata) buildplates = machine.iterfind("./um:buildplate", cls.__namespaces) - buildplate_map = {} # type: Dict[str, Dict[str, bool]] + buildplate_map = {} # type: Dict[str, Dict[str, bool]] buildplate_map["buildplate_compatible"] = {} buildplate_map["buildplate_recommended"] = {} for buildplate in buildplates: