diff options
author | Ghostkeeper <rubend@tutanota.com> | 2019-08-27 17:04:53 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2019-08-27 17:06:09 +0300 |
commit | 20be7fd8a15e4454b604cc1b188887ac6e9628e5 (patch) | |
tree | ace14ea2877618ec6ed359bb598c2cf0c15d1b78 /plugins/XmlMaterialProfile/XmlMaterialProfile.py | |
parent | c333e980dcb34c40d21c013842991adb63530db2 (diff) |
Don't add to variant-specific mapping if it's not variant-specific
Otherwise we'll encounter that the variant name is None when serialising that subprofile.
Contributes to issue CURA-6600.
Diffstat (limited to 'plugins/XmlMaterialProfile/XmlMaterialProfile.py')
-rw-r--r-- | plugins/XmlMaterialProfile/XmlMaterialProfile.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/XmlMaterialProfile/XmlMaterialProfile.py b/plugins/XmlMaterialProfile/XmlMaterialProfile.py index ac53564eaf..cbdec39054 100644 --- a/plugins/XmlMaterialProfile/XmlMaterialProfile.py +++ b/plugins/XmlMaterialProfile/XmlMaterialProfile.py @@ -245,6 +245,7 @@ class XmlMaterialProfile(InstanceContainer): variant_name = container.getMetaDataEntry("variant_name") if not variant_name: machine_container_map[definition_id] = container + continue variant_dict = {"variant_type": container.getMetaDataEntry("hardware_type", str(VariantType.NOZZLE)), "material_container": container} @@ -344,7 +345,7 @@ class XmlMaterialProfile(InstanceContainer): stream = io.BytesIO() tree = ET.ElementTree(root) # this makes sure that the XML header states encoding="utf-8" - tree.write(stream, encoding = "utf-8", xml_declaration=True) + tree.write(stream, encoding = "utf-8", xml_declaration = True) return stream.getvalue().decode("utf-8") |