From a401c1d64f90088fd95a98c2bc4bedcbd82b978f Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 15 Jun 2018 17:03:04 +0200 Subject: [PATCH] Disambiguate between list of metadatas and metadata Because MyPy doesn't allow a variable to change its type later. Contributes to issue CURA-5330. --- plugins/XmlMaterialProfile/XmlMaterialProfile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/XmlMaterialProfile/XmlMaterialProfile.py b/plugins/XmlMaterialProfile/XmlMaterialProfile.py index e1e17b20ea..eafb504deb 100644 --- a/plugins/XmlMaterialProfile/XmlMaterialProfile.py +++ b/plugins/XmlMaterialProfile/XmlMaterialProfile.py @@ -870,11 +870,11 @@ class XmlMaterialProfile(InstanceContainer): machine_id_list = cls.getPossibleDefinitionIDsFromName(identifier.get("product")) for machine_id in machine_id_list: - definition_metadata = ContainerRegistry.getInstance().findDefinitionContainersMetadata(id = machine_id) - if not definition_metadata: + definition_metadatas = ContainerRegistry.getInstance().findDefinitionContainersMetadata(id = machine_id) + if not definition_metadatas: continue - definition_metadata = definition_metadata[0] + definition_metadata = definition_metadatas[0] machine_manufacturer = identifier.get("manufacturer", definition_metadata.get("manufacturer", "Unknown")) #If the XML material doesn't specify a manufacturer, use the one in the actual printer definition.