Merge branch 'CURA-7608_Ignore_network_information_while_importing_project_files' of github.com:Ultimaker/Cura

This commit is contained in:
Jaime van Kessel 2020-07-28 11:33:34 +02:00
commit 1f7c2be1bc
No known key found for this signature in database
GPG Key ID: 3710727397403C91

View File

@ -5,7 +5,7 @@ from configparser import ConfigParser
import zipfile
import os
import json
from typing import cast, Dict, List, Optional, Tuple, Any
from typing import cast, Dict, List, Optional, Tuple, Any, Set
import xml.etree.ElementTree as ET
@ -41,6 +41,18 @@ from .WorkspaceDialog import WorkspaceDialog
i18n_catalog = i18nCatalog("cura")
_ignored_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 ContainerInfo:
def __init__(self, file_name: Optional[str], serialized: Optional[str], parser: Optional[ConfigParser]) -> None:
self.file_name = file_name
@ -1069,6 +1081,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
# Set metadata fields that are missing from the global stack
for key, value in self._machine_info.metadata_dict.items():
if key not in _ignored_machine_network_metadata:
global_stack.setMetaDataEntry(key, value)
def _updateActiveMachine(self, global_stack):
@ -1080,7 +1093,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
# Set metadata fields that are missing from the global stack
for key, value in self._machine_info.metadata_dict.items():
if key not in global_stack.getMetaData():
if key not in global_stack.getMetaData() and key not in _ignored_machine_network_metadata:
global_stack.setMetaDataEntry(key, value)
if self._quality_changes_to_apply: