Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime van Kessel <nallath@gmail.com>2019-07-22 17:41:08 +0300
committerJaime van Kessel <nallath@gmail.com>2019-07-22 17:41:08 +0300
commit00f21069e75cd69f9f1ac9c80c4ec6c959607f64 (patch)
tree2ab7e7b2ce5759ece01ed2e3b69e02eb38df4bc1 /plugins/XmlMaterialProfile/XmlMaterialProfile.py
parent678621469f51ac6014378cfbe3d9f6590f6d25cf (diff)
Ensure that metadata entries in cura namespace are stored correctly
CURA-6672
Diffstat (limited to 'plugins/XmlMaterialProfile/XmlMaterialProfile.py')
-rw-r--r--plugins/XmlMaterialProfile/XmlMaterialProfile.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/XmlMaterialProfile/XmlMaterialProfile.py b/plugins/XmlMaterialProfile/XmlMaterialProfile.py
index 68c8efc50f..f8cd2dda71 100644
--- a/plugins/XmlMaterialProfile/XmlMaterialProfile.py
+++ b/plugins/XmlMaterialProfile/XmlMaterialProfile.py
@@ -190,13 +190,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
@@ -1183,6 +1186,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",