mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Use optional arg in serialize() to exclude network auth keys
CURA-4049
This commit is contained in:
parent
7f1dfcf433
commit
68989f2871
2 changed files with 10 additions and 11 deletions
|
@ -109,7 +109,7 @@ class XmlMaterialProfile(InstanceContainer):
|
|||
## Overridden from InstanceContainer
|
||||
# base file: common settings + supported machines
|
||||
# machine / variant combination: only changes for itself.
|
||||
def serialize(self):
|
||||
def serialize(self, ignore_metadata_keys=[]):
|
||||
registry = ContainerRegistry.getInstance()
|
||||
|
||||
base_file = self.getMetaDataEntry("base_file", "")
|
||||
|
@ -129,6 +129,10 @@ class XmlMaterialProfile(InstanceContainer):
|
|||
builder.start("metadata")
|
||||
|
||||
metadata = copy.deepcopy(self.getMetaData())
|
||||
# remove the keys that we want to ignore in the metadata
|
||||
for key in ignore_metadata_keys:
|
||||
if key in metadata:
|
||||
del metadata[key]
|
||||
properties = metadata.pop("properties", {})
|
||||
|
||||
# Metadata properties that should not be serialized.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue