mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 18:27:51 -06:00
Make ignored metadata keys a set
It needs to be a set now for Uranium. Contributes to issue CURA-4243.
This commit is contained in:
parent
6c4c7fff4d
commit
7ac3c1446b
2 changed files with 4 additions and 4 deletions
|
@ -95,7 +95,7 @@ class ThreeMFWorkspaceWriter(WorkspaceWriter):
|
||||||
file_in_archive.compress_type = zipfile.ZIP_DEFLATED
|
file_in_archive.compress_type = zipfile.ZIP_DEFLATED
|
||||||
|
|
||||||
# Do not include the network authentication keys
|
# Do not include the network authentication keys
|
||||||
ignore_keys = ["network_authentication_id", "network_authentication_key"]
|
ignore_keys = {"network_authentication_id", "network_authentication_key"}
|
||||||
serialized_data = container.serialize(ignored_metadata_keys = ignore_keys)
|
serialized_data = container.serialize(ignored_metadata_keys = ignore_keys)
|
||||||
|
|
||||||
archive.writestr(file_in_archive, serialized_data)
|
archive.writestr(file_in_archive, serialized_data)
|
||||||
|
|
|
@ -97,7 +97,7 @@ class XmlMaterialProfile(InstanceContainer):
|
||||||
## Overridden from InstanceContainer
|
## Overridden from InstanceContainer
|
||||||
# base file: common settings + supported machines
|
# base file: common settings + supported machines
|
||||||
# machine / variant combination: only changes for itself.
|
# machine / variant combination: only changes for itself.
|
||||||
def serialize(self, ignored_metadata_keys: Optional[List] = None):
|
def serialize(self, ignored_metadata_keys: Optional[set] = None):
|
||||||
registry = ContainerRegistry.getInstance()
|
registry = ContainerRegistry.getInstance()
|
||||||
|
|
||||||
base_file = self.getMetaDataEntry("base_file", "")
|
base_file = self.getMetaDataEntry("base_file", "")
|
||||||
|
@ -119,8 +119,8 @@ class XmlMaterialProfile(InstanceContainer):
|
||||||
metadata = copy.deepcopy(self.getMetaData())
|
metadata = copy.deepcopy(self.getMetaData())
|
||||||
# setting_version is derived from the "version" tag in the schema, so don't serialize it into a file
|
# setting_version is derived from the "version" tag in the schema, so don't serialize it into a file
|
||||||
if ignored_metadata_keys is None:
|
if ignored_metadata_keys is None:
|
||||||
ignored_metadata_keys = []
|
ignored_metadata_keys = set()
|
||||||
ignored_metadata_keys = ignored_metadata_keys + ["setting_version"]
|
ignored_metadata_keys |= {"setting_version"}
|
||||||
# remove the keys that we want to ignore in the metadata
|
# remove the keys that we want to ignore in the metadata
|
||||||
for key in ignored_metadata_keys:
|
for key in ignored_metadata_keys:
|
||||||
if key in metadata:
|
if key in metadata:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue