Disambiguate between list of metadatas and metadata

Because MyPy doesn't allow a variable to change its type later.

Contributes to issue CURA-5330.
This commit is contained in:
Ghostkeeper 2018-06-15 17:03:04 +02:00
parent 79c6b2dad8
commit a401c1d64f
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A

View file

@ -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.