Be robust against older specification version numbers

1.2 and lower didn't specify a version number. Assume that it was 1.2. We feed this through our translation function for form, mostly, because we know that the setting_version should be 0 then.

Contributes to issue CURA-3427.
This commit is contained in:
Ghostkeeper 2017-05-12 17:08:47 +02:00
parent 365f7cad4c
commit 2365267f35
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75

View file

@ -423,7 +423,10 @@ class XmlMaterialProfile(InstanceContainer):
inherited = self._resolveInheritance(inherits.text)
data = self._mergeXML(inherited, data)
if "version" in data.attrib:
meta_data["setting_version"] = self.xmlVersionToSettingVersion(data.attrib["version"])
else:
meta_data["setting_version"] = self.xmlVersionToSettingVersion("1.2") #1.2 and lower didn't have that version number there yet.
metadata = data.iterfind("./um:metadata/*", self.__namespaces)
for entry in metadata:
tag_name = _tag_without_namespace(entry)