diff options
author | Ghostkeeper <rubend@tutanota.com> | 2019-08-13 15:59:05 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2019-08-13 15:59:05 +0300 |
commit | 6a8e1557c3683c7378cb0df002fac6ccec61a42a (patch) | |
tree | 43d82cd6a224ee024efebe4f9fe791ff5b3c987c /plugins/XmlMaterialProfile | |
parent | 8fb0a09460cd58624efe0087dc5735a6a2b5ea69 (diff) | |
parent | 20201c65e60f753e4efd3e540f5a1e6e6cc15d4a (diff) |
Merge branch 'feature_intent' into feature_intent_container_tree
Conflicts:
.gitlab-ci.yml
cura/Machines/MaterialManager.py
cura/Machines/VariantManager.py
cura/Settings/ContainerManager.py
cura/Settings/MachineManager.py
tests/TestMachineManager.py
Diffstat (limited to 'plugins/XmlMaterialProfile')
-rw-r--r-- | plugins/XmlMaterialProfile/XmlMaterialProfile.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/plugins/XmlMaterialProfile/XmlMaterialProfile.py b/plugins/XmlMaterialProfile/XmlMaterialProfile.py index ae59ec181a..a26fc2eeaa 100644 --- a/plugins/XmlMaterialProfile/XmlMaterialProfile.py +++ b/plugins/XmlMaterialProfile/XmlMaterialProfile.py @@ -191,13 +191,16 @@ class XmlMaterialProfile(InstanceContainer): ## End Name Block for key, value in metadata.items(): - builder.start(key) # type: ignore + key_to_use = key + if key in self._metadata_tags_that_have_cura_namespace: + key_to_use = "cura:" + key_to_use + builder.start(key_to_use) # type: ignore if value is not None: #Nones get handled well by the builder. #Otherwise the builder always expects a string. #Deserialize expects the stringified version. value = str(value) builder.data(value) - builder.end(key) + builder.end(key_to_use) builder.end("metadata") ## End Metadata Block @@ -878,7 +881,7 @@ class XmlMaterialProfile(InstanceContainer): machine_compatibility = cls._parseCompatibleValue(entry.text) for identifier in machine.iterfind("./um:machine_identifier", cls.__namespaces): - machine_id_list = product_id_map.get(identifier.get("product"), []) + machine_id_list = product_id_map.get(identifier.get("product", ""), []) if not machine_id_list: machine_id_list = cls.getPossibleDefinitionIDsFromName(identifier.get("product")) @@ -910,7 +913,7 @@ class XmlMaterialProfile(InstanceContainer): result_metadata.append(new_material_metadata) buildplates = machine.iterfind("./um:buildplate", cls.__namespaces) - buildplate_map = {} # type: Dict[str, Dict[str, bool]] + buildplate_map = {} # type: Dict[str, Dict[str, bool]] buildplate_map["buildplate_compatible"] = {} buildplate_map["buildplate_recommended"] = {} for buildplate in buildplates: @@ -1095,6 +1098,8 @@ class XmlMaterialProfile(InstanceContainer): def __str__(self): return "<XmlMaterialProfile '{my_id}' ('{name}') from base file '{base_file}'>".format(my_id = self.getId(), name = self.getName(), base_file = self.getMetaDataEntry("base_file")) + _metadata_tags_that_have_cura_namespace = {"pva_compatible", "breakaway_compatible"} + # Map XML file setting names to internal names __material_settings_setting_map = { "print temperature": "default_material_print_temperature", @@ -1108,11 +1113,11 @@ class XmlMaterialProfile(InstanceContainer): "surface energy": "material_surface_energy", "shrinkage percentage": "material_shrinkage_percentage", "build volume temperature": "build_volume_temperature", - "anti ooze retracted position": "material_anti_ooze_retracted_position", + "anti ooze retract position": "material_anti_ooze_retracted_position", "anti ooze retract speed": "material_anti_ooze_retraction_speed", - "break preparation retracted position": "material_break_preparation_retracted_position", + "break preparation position": "material_break_preparation_retracted_position", "break preparation speed": "material_break_preparation_speed", - "break retracted position": "material_break_retracted_position", + "break position": "material_break_retracted_position", "break speed": "material_break_speed", "break temperature": "material_break_temperature" } |