mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 15:37:27 -06:00
Fixed XmlMaterialProfile serialize for booleans. Contributes to CURA-2159
This commit is contained in:
parent
edb1a143ea
commit
df536e158b
1 changed files with 5 additions and 1 deletions
|
@ -134,6 +134,10 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
||||||
|
|
||||||
for key, value in metadata.items():
|
for key, value in metadata.items():
|
||||||
builder.start(key)
|
builder.start(key)
|
||||||
|
# Normally value is a string.
|
||||||
|
# Nones get handled well.
|
||||||
|
if isinstance(value, bool):
|
||||||
|
value = str(value) # parseBool in deserialize expects 'True'.
|
||||||
builder.data(value)
|
builder.data(value)
|
||||||
builder.end(key)
|
builder.end(key)
|
||||||
|
|
||||||
|
@ -226,7 +230,7 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
||||||
_indent(root)
|
_indent(root)
|
||||||
stream = io.StringIO()
|
stream = io.StringIO()
|
||||||
tree = ET.ElementTree(root)
|
tree = ET.ElementTree(root)
|
||||||
tree.write(stream, "unicode", True)
|
tree.write(stream, encoding="unicode", xml_declaration=True)
|
||||||
|
|
||||||
return stream.getvalue()
|
return stream.getvalue()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue