mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
Improve GUID check by parsing xml and getting GUID specifically inside the metadata tag.
Remove exporting materials from disabled extruders CURA-8610
This commit is contained in:
parent
3dec025cb8
commit
cdc08b5d54
3 changed files with 19 additions and 3 deletions
|
@ -480,6 +480,15 @@ class XmlMaterialProfile(InstanceContainer):
|
|||
|
||||
return version * 1000000 + setting_version
|
||||
|
||||
@classmethod
|
||||
def getMetadataFromSerialized(cls, serialized: str, property_name: str) -> str:
|
||||
data = ET.fromstring(serialized)
|
||||
metadata = data.find("./um:metadata", cls.__namespaces)
|
||||
property = metadata.find("./um:" + property_name, cls.__namespaces)
|
||||
|
||||
# This is a necessary property != None check, xml library overrides __bool__ to return False in cases when Element is not None.
|
||||
return property.text if property != None else ""
|
||||
|
||||
def deserialize(self, serialized, file_name = None):
|
||||
"""Overridden from InstanceContainer"""
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue