Ignore MyPy errors caused by DepthFirstIterator not being detected as iterator

MyPy is wrong in this case.

Contributes to issue CURA-5330.
This commit is contained in:
Ghostkeeper 2018-06-15 11:02:15 +02:00
parent 4418cf3aac
commit c3d4d5eba7
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A

View file

@ -1,4 +1,4 @@
# Copyright (c) 2017 Ultimaker B.V.
# Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from PyQt5.QtCore import pyqtSignal, pyqtProperty, QObject, QVariant # For communicating data and events to Qt.
@ -136,7 +136,7 @@ class ExtruderManager(QObject):
selected_nodes = []
for node in Selection.getAllSelectedObjects():
if node.callDecoration("isGroup"):
for grouped_node in BreadthFirstIterator(node):
for grouped_node in BreadthFirstIterator(node): #type: ignore #Ignore type error because iter() should get called automatically by Python syntax.
if grouped_node.callDecoration("isGroup"):
continue
@ -265,7 +265,7 @@ class ExtruderManager(QObject):
return []
# Get the extruders of all printable meshes in the scene
meshes = [node for node in DepthFirstIterator(scene_root) if isinstance(node, SceneNode) and node.isSelectable()]
meshes = [node for node in DepthFirstIterator(scene_root) if isinstance(node, SceneNode) and node.isSelectable()] #type: ignore #Ignore type error because iter() should get called automatically by Python syntax.
for mesh in meshes:
extruder_stack_id = mesh.callDecoration("getActiveExtruder")
if not extruder_stack_id: