mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
CURA-7608 Ignore machine network information when handling project files (#8116)
CURA-7608
This commit is contained in:
parent
d6a2c1d46d
commit
7bf1af99a5
2 changed files with 28 additions and 1 deletions
|
@ -136,7 +136,17 @@ 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", "octoprint_api_key"}
|
ignore_keys = {
|
||||||
|
"um_cloud_cluster_id",
|
||||||
|
"um_network_key",
|
||||||
|
"um_linked_to_account",
|
||||||
|
"removal_warning",
|
||||||
|
"host_guid",
|
||||||
|
"group_name",
|
||||||
|
"group_size",
|
||||||
|
"connection_type",
|
||||||
|
"octoprint_api_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)
|
||||||
|
|
|
@ -25,6 +25,18 @@ _removed_settings = {
|
||||||
"support_tree_enable"
|
"support_tree_enable"
|
||||||
} # type: Set[str]
|
} # type: Set[str]
|
||||||
|
|
||||||
|
_removed_machine_network_metadata = {
|
||||||
|
"um_cloud_cluster_id",
|
||||||
|
"um_network_key",
|
||||||
|
"um_linked_to_account",
|
||||||
|
"host_guid",
|
||||||
|
"removal_warning",
|
||||||
|
"group_name",
|
||||||
|
"group_size",
|
||||||
|
"connection_type"
|
||||||
|
} # type: Set[str]
|
||||||
|
|
||||||
|
|
||||||
class VersionUpgrade462to47(VersionUpgrade):
|
class VersionUpgrade462to47(VersionUpgrade):
|
||||||
def upgradePreferences(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]:
|
def upgradePreferences(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]:
|
||||||
"""
|
"""
|
||||||
|
@ -136,6 +148,11 @@ class VersionUpgrade462to47(VersionUpgrade):
|
||||||
parser["metadata"] = {}
|
parser["metadata"] = {}
|
||||||
parser["metadata"]["setting_version"] = "15"
|
parser["metadata"]["setting_version"] = "15"
|
||||||
|
|
||||||
|
# Remove machine network information from project file
|
||||||
|
for network_info in _removed_machine_network_metadata:
|
||||||
|
if network_info in parser["metadata"]:
|
||||||
|
del parser["metadata"][network_info]
|
||||||
|
|
||||||
# Update Pause at Height script parameters if present.
|
# Update Pause at Height script parameters if present.
|
||||||
if "post_processing_scripts" in parser["metadata"]:
|
if "post_processing_scripts" in parser["metadata"]:
|
||||||
new_scripts_entries = []
|
new_scripts_entries = []
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue