Fix typing

This commit is contained in:
Lipu Fei 2019-09-19 14:34:52 +02:00
parent d8b59c4471
commit 6e625b2cf8

View file

@ -1305,9 +1305,10 @@ class MachineManager(QObject):
self._setMaterial(position_item, new_material) self._setMaterial(position_item, new_material)
else: else:
# The current material is not available, find the preferred one. # The current material is not available, find the preferred one.
approximate_material_diameter = int(self._global_container_stack.extruderList[int(position)].getApproximateMaterialDiameter()) if position is not None:
material_node = nozzle_node.preferredMaterial(approximate_material_diameter) approximate_material_diameter = int(self._global_container_stack.extruderList[int(position)].getApproximateMaterialDiameter())
self._setMaterial(position_item, material_node) material_node = nozzle_node.preferredMaterial(approximate_material_diameter)
self._setMaterial(position_item, material_node)
## Given a printer definition name, select the right machine instance. In case it doesn't exist, create a new ## Given a printer definition name, select the right machine instance. In case it doesn't exist, create a new
# instance with the same network key. # instance with the same network key.