mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Replace deprecated .getContainer() calls with .container
part of CURA-6600
This commit is contained in:
parent
47fe4b4c90
commit
7fb9642e45
13 changed files with 49 additions and 49 deletions
|
@ -390,7 +390,7 @@ class MaterialManager(QObject):
|
||||||
|
|
||||||
material_group = self.getMaterialGroup(root_material_id)
|
material_group = self.getMaterialGroup(root_material_id)
|
||||||
if material_group:
|
if material_group:
|
||||||
container = material_group.root_material_node.getContainer()
|
container = material_group.root_material_node.container
|
||||||
if container:
|
if container:
|
||||||
container.setName(name)
|
container.setName(name)
|
||||||
|
|
||||||
|
@ -416,7 +416,7 @@ class MaterialManager(QObject):
|
||||||
Logger.log("i", "Unable to duplicate the material with id %s, because it doesn't exist.", root_material_id)
|
Logger.log("i", "Unable to duplicate the material with id %s, because it doesn't exist.", root_material_id)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
base_container = material_group.root_material_node.getContainer()
|
base_container = material_group.root_material_node.container
|
||||||
if not base_container:
|
if not base_container:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -438,7 +438,7 @@ class MaterialManager(QObject):
|
||||||
|
|
||||||
# Clone all of them.
|
# Clone all of them.
|
||||||
for node in material_group.derived_material_node_list:
|
for node in material_group.derived_material_node_list:
|
||||||
container_to_copy = node.getContainer()
|
container_to_copy = node.container
|
||||||
if not container_to_copy:
|
if not container_to_copy:
|
||||||
continue
|
continue
|
||||||
# Create unique IDs for every clone.
|
# Create unique IDs for every clone.
|
||||||
|
|
|
@ -106,7 +106,7 @@ class QualityProfilesDropDownMenuModel(ListModel):
|
||||||
# Get layer_height from the quality profile for the GlobalStack
|
# Get layer_height from the quality profile for the GlobalStack
|
||||||
if quality_group.node_for_global is None:
|
if quality_group.node_for_global is None:
|
||||||
return float(default_layer_height)
|
return float(default_layer_height)
|
||||||
container = quality_group.node_for_global.getContainer()
|
container = quality_group.node_for_global.container
|
||||||
|
|
||||||
layer_height = default_layer_height
|
layer_height = default_layer_height
|
||||||
if container and container.hasProperty("layer_height", "value"):
|
if container and container.hasProperty("layer_height", "value"):
|
||||||
|
|
|
@ -103,8 +103,8 @@ class QualitySettingsModel(ListModel):
|
||||||
quality_changes_node = quality_changes_group.node_for_global
|
quality_changes_node = quality_changes_group.node_for_global
|
||||||
else:
|
else:
|
||||||
quality_changes_node = quality_changes_group.nodes_for_extruders.get(str(self._selected_position))
|
quality_changes_node = quality_changes_group.nodes_for_extruders.get(str(self._selected_position))
|
||||||
if quality_changes_node is not None and quality_changes_node.getContainer() is not None: # it can be None if number of extruders are changed during runtime
|
if quality_changes_node is not None and quality_changes_node.container is not None: # it can be None if number of extruders are changed during runtime
|
||||||
quality_containers.insert(0, quality_changes_node.getContainer())
|
quality_containers.insert(0, quality_changes_node.container)
|
||||||
settings_keys.update(quality_changes_group.getAllKeys())
|
settings_keys.update(quality_changes_group.getAllKeys())
|
||||||
|
|
||||||
# We iterate over all definitions instead of settings in a quality/qualtiy_changes group is because in the GUI,
|
# We iterate over all definitions instead of settings in a quality/qualtiy_changes group is because in the GUI,
|
||||||
|
|
|
@ -43,7 +43,7 @@ class QualityGroup(QObject):
|
||||||
for node in [self.node_for_global] + list(self.nodes_for_extruders.values()):
|
for node in [self.node_for_global] + list(self.nodes_for_extruders.values()):
|
||||||
if node is None:
|
if node is None:
|
||||||
continue
|
continue
|
||||||
container = node.getContainer()
|
container = node.container
|
||||||
if container:
|
if container:
|
||||||
result.update(container.getAllKeys())
|
result.update(container.getAllKeys())
|
||||||
return result
|
return result
|
||||||
|
|
|
@ -204,7 +204,7 @@ class QualityManager(QObject):
|
||||||
|
|
||||||
new_name = self._container_registry.uniqueName(new_name)
|
new_name = self._container_registry.uniqueName(new_name)
|
||||||
for node in quality_changes_group.getAllNodes():
|
for node in quality_changes_group.getAllNodes():
|
||||||
container = node.getContainer()
|
container = node.container
|
||||||
if container:
|
if container:
|
||||||
container.setName(new_name)
|
container.setName(new_name)
|
||||||
|
|
||||||
|
@ -237,7 +237,7 @@ class QualityManager(QObject):
|
||||||
else:
|
else:
|
||||||
new_name = self._container_registry.uniqueName(quality_changes_name)
|
new_name = self._container_registry.uniqueName(quality_changes_name)
|
||||||
for node in quality_changes_group.getAllNodes():
|
for node in quality_changes_group.getAllNodes():
|
||||||
container = node.getContainer()
|
container = node.container
|
||||||
if not container:
|
if not container:
|
||||||
continue
|
continue
|
||||||
new_id = self._container_registry.uniqueName(container.getId())
|
new_id = self._container_registry.uniqueName(container.getId())
|
||||||
|
|
|
@ -112,7 +112,7 @@ class ContainerManager(QObject):
|
||||||
entry_name = root_name
|
entry_name = root_name
|
||||||
entry_value = root
|
entry_value = root
|
||||||
|
|
||||||
container = material_group.root_material_node.getContainer()
|
container = material_group.root_material_node.container
|
||||||
if container is not None:
|
if container is not None:
|
||||||
container.setMetaDataEntry(entry_name, entry_value)
|
container.setMetaDataEntry(entry_name, entry_value)
|
||||||
if sub_item_changed: #If it was only a sub-item that has changed then the setMetaDataEntry won't correctly notice that something changed, and we must manually signal that the metadata changed.
|
if sub_item_changed: #If it was only a sub-item that has changed then the setMetaDataEntry won't correctly notice that something changed, and we must manually signal that the metadata changed.
|
||||||
|
@ -357,7 +357,7 @@ class ContainerManager(QObject):
|
||||||
# Update the GUID
|
# Update the GUID
|
||||||
# NOTE: We only need to set the root material container because XmlMaterialProfile.setMetaDataEntry() will
|
# NOTE: We only need to set the root material container because XmlMaterialProfile.setMetaDataEntry() will
|
||||||
# take care of the derived containers too
|
# take care of the derived containers too
|
||||||
container = material_group.root_material_node.getContainer()
|
container = material_group.root_material_node.container
|
||||||
if container is not None:
|
if container is not None:
|
||||||
container.setMetaDataEntry("GUID", new_guid)
|
container.setMetaDataEntry("GUID", new_guid)
|
||||||
|
|
||||||
|
@ -436,7 +436,7 @@ class ContainerManager(QObject):
|
||||||
if not path:
|
if not path:
|
||||||
return
|
return
|
||||||
|
|
||||||
container_list = [n.getContainer() for n in quality_changes_group.getAllNodes() if n.getContainer() is not None]
|
container_list = [n.container for n in quality_changes_group.getAllNodes() if n.container is not None]
|
||||||
cura.CuraApplication.CuraApplication.getInstance().getContainerRegistry().exportQualityProfile(container_list, path, file_type)
|
cura.CuraApplication.CuraApplication.getInstance().getContainerRegistry().exportQualityProfile(container_list, path, file_type)
|
||||||
|
|
||||||
__instance = None # type: ContainerManager
|
__instance = None # type: ContainerManager
|
||||||
|
|
|
@ -78,12 +78,12 @@ class CuraStackBuilder:
|
||||||
preferred_quality_type = next(iter(quality_group_dict))
|
preferred_quality_type = next(iter(quality_group_dict))
|
||||||
quality_group = quality_group_dict.get(preferred_quality_type)
|
quality_group = quality_group_dict.get(preferred_quality_type)
|
||||||
|
|
||||||
new_global_stack.quality = quality_group.node_for_global.getContainer()
|
new_global_stack.quality = quality_group.node_for_global.container
|
||||||
if not new_global_stack.quality:
|
if not new_global_stack.quality:
|
||||||
new_global_stack.quality = application.empty_quality_container
|
new_global_stack.quality = application.empty_quality_container
|
||||||
for position, extruder_stack in new_global_stack.extruders.items():
|
for position, extruder_stack in new_global_stack.extruders.items():
|
||||||
if position in quality_group.nodes_for_extruders and quality_group.nodes_for_extruders[position].getContainer():
|
if position in quality_group.nodes_for_extruders and quality_group.nodes_for_extruders[position].container:
|
||||||
extruder_stack.quality = quality_group.nodes_for_extruders[position].getContainer()
|
extruder_stack.quality = quality_group.nodes_for_extruders[position].container
|
||||||
else:
|
else:
|
||||||
extruder_stack.quality = application.empty_quality_container
|
extruder_stack.quality = application.empty_quality_container
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ class CuraStackBuilder:
|
||||||
extruder_variant_node = machine_node.variants.get(machine_node.preferred_variant_name)
|
extruder_variant_node = machine_node.variants.get(machine_node.preferred_variant_name)
|
||||||
extruder_variant_name = None
|
extruder_variant_name = None
|
||||||
if extruder_variant_node is not None:
|
if extruder_variant_node is not None:
|
||||||
extruder_variant_container = extruder_variant_node.getContainer()
|
extruder_variant_container = extruder_variant_node.container
|
||||||
if not extruder_variant_container:
|
if not extruder_variant_container:
|
||||||
extruder_variant_container = application.empty_variant_container
|
extruder_variant_container = application.empty_variant_container
|
||||||
extruder_variant_name = extruder_variant_container.getName()
|
extruder_variant_name = extruder_variant_container.getName()
|
||||||
|
@ -134,8 +134,8 @@ class CuraStackBuilder:
|
||||||
material_container = application.empty_material_container
|
material_container = application.empty_material_container
|
||||||
material_node = material_manager.getDefaultMaterial(global_stack, str(extruder_position), extruder_variant_name,
|
material_node = material_manager.getDefaultMaterial(global_stack, str(extruder_position), extruder_variant_name,
|
||||||
extruder_definition = extruder_definition)
|
extruder_definition = extruder_definition)
|
||||||
if material_node and material_node.getContainer():
|
if material_node and material_node.container:
|
||||||
material_container = material_node.getContainer()
|
material_container = material_node.container
|
||||||
|
|
||||||
new_extruder_id = registry.uniqueName(extruder_definition_id)
|
new_extruder_id = registry.uniqueName(extruder_definition_id)
|
||||||
new_extruder = cls.createExtruderStack(
|
new_extruder = cls.createExtruderStack(
|
||||||
|
|
|
@ -1160,10 +1160,10 @@ class MachineManager(QObject):
|
||||||
self._setEmptyQuality()
|
self._setEmptyQuality()
|
||||||
return
|
return
|
||||||
|
|
||||||
if quality_group.node_for_global is None or quality_group.node_for_global.getContainer() is None:
|
if quality_group.node_for_global is None or quality_group.node_for_global.container is None:
|
||||||
return
|
return
|
||||||
for node in quality_group.nodes_for_extruders.values():
|
for node in quality_group.nodes_for_extruders.values():
|
||||||
if node.getContainer() is None:
|
if node.container is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
self._current_quality_group = quality_group
|
self._current_quality_group = quality_group
|
||||||
|
@ -1171,13 +1171,13 @@ class MachineManager(QObject):
|
||||||
self._current_quality_changes_group = None
|
self._current_quality_changes_group = None
|
||||||
|
|
||||||
# Set quality and quality_changes for the GlobalStack
|
# Set quality and quality_changes for the GlobalStack
|
||||||
self._global_container_stack.quality = quality_group.node_for_global.getContainer()
|
self._global_container_stack.quality = quality_group.node_for_global.container
|
||||||
if empty_quality_changes:
|
if empty_quality_changes:
|
||||||
self._global_container_stack.qualityChanges = empty_quality_changes_container
|
self._global_container_stack.qualityChanges = empty_quality_changes_container
|
||||||
|
|
||||||
# Set quality and quality_changes for each ExtruderStack
|
# Set quality and quality_changes for each ExtruderStack
|
||||||
for position, node in quality_group.nodes_for_extruders.items():
|
for position, node in quality_group.nodes_for_extruders.items():
|
||||||
self._global_container_stack.extruders[str(position)].quality = node.getContainer()
|
self._global_container_stack.extruders[str(position)].quality = node.container
|
||||||
if empty_quality_changes:
|
if empty_quality_changes:
|
||||||
self._global_container_stack.extruders[str(position)].qualityChanges = empty_quality_changes_container
|
self._global_container_stack.extruders[str(position)].qualityChanges = empty_quality_changes_container
|
||||||
|
|
||||||
|
@ -1186,7 +1186,7 @@ class MachineManager(QObject):
|
||||||
|
|
||||||
def _fixQualityChangesGroupToNotSupported(self, quality_changes_group: "QualityChangesGroup") -> None:
|
def _fixQualityChangesGroupToNotSupported(self, quality_changes_group: "QualityChangesGroup") -> None:
|
||||||
nodes = [quality_changes_group.node_for_global] + list(quality_changes_group.nodes_for_extruders.values())
|
nodes = [quality_changes_group.node_for_global] + list(quality_changes_group.nodes_for_extruders.values())
|
||||||
containers = [n.getContainer() for n in nodes if n is not None]
|
containers = [n.container for n in nodes if n is not None]
|
||||||
for container in containers:
|
for container in containers:
|
||||||
if container:
|
if container:
|
||||||
container.setMetaDataEntry("quality_type", "not_supported")
|
container.setMetaDataEntry("quality_type", "not_supported")
|
||||||
|
@ -1207,10 +1207,10 @@ class MachineManager(QObject):
|
||||||
|
|
||||||
quality_changes_container = empty_quality_changes_container
|
quality_changes_container = empty_quality_changes_container
|
||||||
quality_container = empty_quality_container # type: Optional[InstanceContainer]
|
quality_container = empty_quality_container # type: Optional[InstanceContainer]
|
||||||
if quality_changes_group.node_for_global and quality_changes_group.node_for_global.getContainer():
|
if quality_changes_group.node_for_global and quality_changes_group.node_for_global.container:
|
||||||
quality_changes_container = cast(InstanceContainer, quality_changes_group.node_for_global.getContainer())
|
quality_changes_container = cast(InstanceContainer, quality_changes_group.node_for_global.container)
|
||||||
if quality_group is not None and quality_group.node_for_global and quality_group.node_for_global.getContainer():
|
if quality_group is not None and quality_group.node_for_global and quality_group.node_for_global.container:
|
||||||
quality_container = quality_group.node_for_global.getContainer()
|
quality_container = quality_group.node_for_global.container
|
||||||
|
|
||||||
self._global_container_stack.quality = quality_container
|
self._global_container_stack.quality = quality_container
|
||||||
self._global_container_stack.qualityChanges = quality_changes_container
|
self._global_container_stack.qualityChanges = quality_changes_container
|
||||||
|
@ -1223,10 +1223,10 @@ class MachineManager(QObject):
|
||||||
|
|
||||||
quality_changes_container = empty_quality_changes_container
|
quality_changes_container = empty_quality_changes_container
|
||||||
quality_container = empty_quality_container
|
quality_container = empty_quality_container
|
||||||
if quality_changes_node and quality_changes_node.getContainer():
|
if quality_changes_node and quality_changes_node.container:
|
||||||
quality_changes_container = cast(InstanceContainer, quality_changes_node.getContainer())
|
quality_changes_container = cast(InstanceContainer, quality_changes_node.container)
|
||||||
if quality_node and quality_node.getContainer():
|
if quality_node and quality_node.container:
|
||||||
quality_container = quality_node.getContainer()
|
quality_container = quality_node.container
|
||||||
|
|
||||||
extruder.quality = quality_container
|
extruder.quality = quality_container
|
||||||
extruder.qualityChanges = quality_changes_container
|
extruder.qualityChanges = quality_changes_container
|
||||||
|
@ -1245,7 +1245,7 @@ class MachineManager(QObject):
|
||||||
def _setGlobalVariant(self, container_node: "ContainerNode") -> None:
|
def _setGlobalVariant(self, container_node: "ContainerNode") -> None:
|
||||||
if self._global_container_stack is None:
|
if self._global_container_stack is None:
|
||||||
return
|
return
|
||||||
self._global_container_stack.variant = container_node.getContainer()
|
self._global_container_stack.variant = container_node.container
|
||||||
if not self._global_container_stack.variant:
|
if not self._global_container_stack.variant:
|
||||||
self._global_container_stack.variant = self._application.empty_variant_container
|
self._global_container_stack.variant = self._application.empty_variant_container
|
||||||
|
|
||||||
|
@ -1501,7 +1501,7 @@ class MachineManager(QObject):
|
||||||
@pyqtSlot(str, "QVariant")
|
@pyqtSlot(str, "QVariant")
|
||||||
def setMaterial(self, position: str, container_node, global_stack: Optional["GlobalStack"] = None) -> None:
|
def setMaterial(self, position: str, container_node, global_stack: Optional["GlobalStack"] = None) -> None:
|
||||||
if global_stack is not None and global_stack != self._global_container_stack:
|
if global_stack is not None and global_stack != self._global_container_stack:
|
||||||
global_stack.extruders[position].material = container_node.getContainer()
|
global_stack.extruders[position].material = container_node.container
|
||||||
return
|
return
|
||||||
position = str(position)
|
position = str(position)
|
||||||
self.blurSettings.emit()
|
self.blurSettings.emit()
|
||||||
|
@ -1555,11 +1555,11 @@ class MachineManager(QObject):
|
||||||
Logger.log("e", "Could not set quality group [%s] because it has no node_for_global", str(quality_group))
|
Logger.log("e", "Could not set quality group [%s] because it has no node_for_global", str(quality_group))
|
||||||
return
|
return
|
||||||
# This is not changing the quality for the active machine !!!!!!!!
|
# This is not changing the quality for the active machine !!!!!!!!
|
||||||
global_stack.quality = quality_group.node_for_global.getContainer()
|
global_stack.quality = quality_group.node_for_global.container
|
||||||
for extruder_nr, extruder_stack in global_stack.extruders.items():
|
for extruder_nr, extruder_stack in global_stack.extruders.items():
|
||||||
quality_container = empty_quality_container
|
quality_container = empty_quality_container
|
||||||
if extruder_nr in quality_group.nodes_for_extruders:
|
if extruder_nr in quality_group.nodes_for_extruders:
|
||||||
container = quality_group.nodes_for_extruders[extruder_nr].getContainer()
|
container = quality_group.nodes_for_extruders[extruder_nr].container
|
||||||
quality_container = container if container is not None else quality_container
|
quality_container = container if container is not None else quality_container
|
||||||
extruder_stack.quality = quality_container
|
extruder_stack.quality = quality_container
|
||||||
return
|
return
|
||||||
|
|
|
@ -901,8 +901,8 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||||
variant_type = VariantType.BUILD_PLATE
|
variant_type = VariantType.BUILD_PLATE
|
||||||
|
|
||||||
node = variant_manager.getVariantNode(global_stack.definition.getId(), variant_name, variant_type)
|
node = variant_manager.getVariantNode(global_stack.definition.getId(), variant_name, variant_type)
|
||||||
if node is not None and node.getContainer() is not None:
|
if node is not None and node.container is not None:
|
||||||
global_stack.variant = node.getContainer()
|
global_stack.variant = node.container
|
||||||
|
|
||||||
for position, extruder_stack in extruder_stack_dict.items():
|
for position, extruder_stack in extruder_stack_dict.items():
|
||||||
if position not in self._machine_info.extruder_info_dict:
|
if position not in self._machine_info.extruder_info_dict:
|
||||||
|
@ -911,8 +911,8 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||||
if extruder_info.variant_info is None:
|
if extruder_info.variant_info is None:
|
||||||
# If there is no variant_info, try to use the default variant. Otherwise, leave it be.
|
# If there is no variant_info, try to use the default variant. Otherwise, leave it be.
|
||||||
node = variant_manager.getDefaultVariantNode(global_stack.definition, VariantType.NOZZLE, global_stack)
|
node = variant_manager.getDefaultVariantNode(global_stack.definition, VariantType.NOZZLE, global_stack)
|
||||||
if node is not None and node.getContainer() is not None:
|
if node is not None and node.container is not None:
|
||||||
extruder_stack.variant = node.getContainer()
|
extruder_stack.variant = node.container
|
||||||
continue
|
continue
|
||||||
parser = extruder_info.variant_info.parser
|
parser = extruder_info.variant_info.parser
|
||||||
|
|
||||||
|
@ -920,8 +920,8 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||||
variant_type = VariantType.NOZZLE
|
variant_type = VariantType.NOZZLE
|
||||||
|
|
||||||
node = variant_manager.getVariantNode(global_stack.definition.getId(), variant_name, variant_type)
|
node = variant_manager.getVariantNode(global_stack.definition.getId(), variant_name, variant_type)
|
||||||
if node is not None and node.getContainer() is not None:
|
if node is not None and node.container is not None:
|
||||||
extruder_stack.variant = node.getContainer()
|
extruder_stack.variant = node.container
|
||||||
|
|
||||||
def _applyMaterials(self, global_stack, extruder_stack_dict):
|
def _applyMaterials(self, global_stack, extruder_stack_dict):
|
||||||
application = CuraApplication.getInstance()
|
application = CuraApplication.getInstance()
|
||||||
|
@ -947,8 +947,8 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||||
machine_material_diameter,
|
machine_material_diameter,
|
||||||
root_material_id)
|
root_material_id)
|
||||||
|
|
||||||
if material_node is not None and material_node.getContainer() is not None:
|
if material_node is not None and material_node.container is not None:
|
||||||
extruder_stack.material = material_node.getContainer() # type: InstanceContainer
|
extruder_stack.material = material_node.container # type: InstanceContainer
|
||||||
|
|
||||||
def _applyChangesToMachine(self, global_stack, extruder_stack_dict):
|
def _applyChangesToMachine(self, global_stack, extruder_stack_dict):
|
||||||
# Clear all first
|
# Clear all first
|
||||||
|
|
|
@ -112,7 +112,7 @@ class UFPWriter(MeshWriter):
|
||||||
Logger.log("e", "Cannot find material container with root id [%s]", material_root_id)
|
Logger.log("e", "Cannot find material container with root id [%s]", material_root_id)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
material_container = material_group.root_material_node.getContainer()
|
material_container = material_group.root_material_node.container
|
||||||
try:
|
try:
|
||||||
serialized_material = material_container.serialize()
|
serialized_material = material_container.serialize()
|
||||||
except NotImplementedError:
|
except NotImplementedError:
|
||||||
|
|
|
@ -41,7 +41,7 @@ class ClusterPrinterConfigurationMaterial(BaseModel):
|
||||||
material_group = non_read_only_material_group_list[0]
|
material_group = non_read_only_material_group_list[0]
|
||||||
|
|
||||||
if material_group:
|
if material_group:
|
||||||
container = material_group.root_material_node.getContainer()
|
container = material_group.root_material_node.container
|
||||||
color = container.getMetaDataEntry("color_code")
|
color = container.getMetaDataEntry("color_code")
|
||||||
brand = container.getMetaDataEntry("brand")
|
brand = container.getMetaDataEntry("brand")
|
||||||
material_type = container.getMetaDataEntry("material")
|
material_type = container.getMetaDataEntry("material")
|
||||||
|
|
|
@ -89,7 +89,7 @@ class XmlMaterialProfile(InstanceContainer):
|
||||||
self.setProperty(k, "value", v)
|
self.setProperty(k, "value", v)
|
||||||
return
|
return
|
||||||
# Update the root material container
|
# Update the root material container
|
||||||
root_material_container = material_group.root_material_node.getContainer()
|
root_material_container = material_group.root_material_node.container
|
||||||
if root_material_container is not None:
|
if root_material_container is not None:
|
||||||
root_material_container.setMetaDataEntry(key, value, apply_to_all = False)
|
root_material_container.setMetaDataEntry(key, value, apply_to_all = False)
|
||||||
for k, v in new_setting_values_dict.items():
|
for k, v in new_setting_values_dict.items():
|
||||||
|
@ -97,7 +97,7 @@ class XmlMaterialProfile(InstanceContainer):
|
||||||
|
|
||||||
# Update all containers derived from it
|
# Update all containers derived from it
|
||||||
for node in material_group.derived_material_node_list:
|
for node in material_group.derived_material_node_list:
|
||||||
container = node.getContainer()
|
container = node.container
|
||||||
if container is not None:
|
if container is not None:
|
||||||
container.setMetaDataEntry(key, value, apply_to_all = False)
|
container.setMetaDataEntry(key, value, apply_to_all = False)
|
||||||
for k, v in new_setting_values_dict.items():
|
for k, v in new_setting_values_dict.items():
|
||||||
|
|
|
@ -48,12 +48,12 @@ def test_createMachine(application, container_registry, definition_container, gl
|
||||||
variant_manager = MagicMock(name = "Variant Manager")
|
variant_manager = MagicMock(name = "Variant Manager")
|
||||||
quality_manager = MagicMock(name = "Quality Manager")
|
quality_manager = MagicMock(name = "Quality Manager")
|
||||||
global_variant_node = MagicMock( name = "global variant node")
|
global_variant_node = MagicMock( name = "global variant node")
|
||||||
global_variant_node.getContainer = MagicMock(return_value = global_variant)
|
global_variant_node.container = global_variant
|
||||||
|
|
||||||
variant_manager.getDefaultVariantNode = MagicMock(return_value = global_variant_node)
|
variant_manager.getDefaultVariantNode = MagicMock(return_value = global_variant_node)
|
||||||
quality_group = QualityGroup(name = "zomg", quality_type = "normal")
|
quality_group = QualityGroup(name = "zomg", quality_type = "normal")
|
||||||
quality_group.node_for_global = MagicMock(name = "Node for global")
|
quality_group.node_for_global = MagicMock(name = "Node for global")
|
||||||
quality_group.node_for_global.getContainer = MagicMock(return_value = quality_container)
|
quality_group.node_for_global.container = quality_container
|
||||||
quality_manager.getQualityGroups = MagicMock(return_value = {"normal": quality_group})
|
quality_manager.getQualityGroups = MagicMock(return_value = {"normal": quality_group})
|
||||||
|
|
||||||
application.getContainerRegistry = MagicMock(return_value=container_registry)
|
application.getContainerRegistry = MagicMock(return_value=container_registry)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue