Fix deprecation warning

CURA-6600
This commit is contained in:
Jaime van Kessel 2019-08-20 14:49:47 +02:00
parent 46b489c3f9
commit b5d826fab9
2 changed files with 4 additions and 4 deletions

View File

@ -24,6 +24,7 @@ class ContainerNode:
self.children_map = {} # type: Dict[str, ContainerNode] # Mapping from container ID to container node. self.children_map = {} # type: Dict[str, ContainerNode] # Mapping from container ID to container node.
## Gets the metadata of the container that this node represents. ## Gets the metadata of the container that this node represents.
# Getting the metadata from the container directly is about 10x as fast.
# \return The metadata of the container in this node. # \return The metadata of the container in this node.
@deprecated("Get the metadata from the container with the ID of this node yourself.", "4.3") @deprecated("Get the metadata from the container with the ID of this node yourself.", "4.3")
def getMetadata(self): def getMetadata(self):

View File

@ -1,6 +1,5 @@
# Copyright (c) 2019 Ultimaker B.V. # Copyright (c) 2019 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 collections import defaultdict from collections import defaultdict
import copy import copy
import uuid import uuid
@ -111,8 +110,8 @@ class MaterialManager(QObject):
# Fetch the available materials (ContainerNode) for the current active machine and extruder setup. # Fetch the available materials (ContainerNode) for the current active machine and extruder setup.
materials = self.getAvailableMaterials(machine.definition.getId(), nozzle_name) materials = self.getAvailableMaterials(machine.definition.getId(), nozzle_name)
compatible_material_diameter = str(round(extruder_stack.getCompatibleMaterialDiameter())) compatible_material_diameter = str(round(extruder_stack.getCompatibleMaterialDiameter()))
result = {key: material for key, material in materials.items() if material.container.getMetaDataEntry("approximate_diameter") == compatible_material_diameter}
return {key: material for key, material in materials.items() if material.getMetaDataEntry("approximate_diameter") == compatible_material_diameter} return result
# #
# Gets MaterialNode for the given extruder and machine with the given material name. # Gets MaterialNode for the given extruder and machine with the given material name.