mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 13:03:59 -06:00
Fix import issues
CURA-6600
This commit is contained in:
parent
fc3461d865
commit
719e69692c
2 changed files with 10 additions and 7 deletions
|
@ -3,6 +3,7 @@
|
|||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from UM.Logger import Logger
|
||||
from UM.Util import parseBool
|
||||
from UM.Settings.ContainerRegistry import ContainerRegistry # To find all the variants for this machine.
|
||||
from UM.Settings.Interfaces import ContainerInterface
|
||||
|
@ -22,8 +23,11 @@ class MachineNode(ContainerNode):
|
|||
self.variants = {} # type: Dict[str, VariantNode] # Mapping variant names to their nodes.
|
||||
self.global_qualities = {} # type: Dict[str, QualityNode] # Mapping quality types to the global quality for those types.
|
||||
container_registry = ContainerRegistry.getInstance()
|
||||
|
||||
my_metadata = container_registry.findContainersMetadata(id = container_id)[0]
|
||||
try:
|
||||
my_metadata = container_registry.findContainersMetadata(id = container_id)[0]
|
||||
except IndexError:
|
||||
Logger.log("Unable to find metadata for container %s", container_id)
|
||||
my_metadata = {}
|
||||
# Some of the metadata is cached upon construction here.
|
||||
# ONLY DO THAT FOR METADATA THAT DOESN'T CHANGE DURING RUNTIME!
|
||||
# Otherwise you need to keep it up-to-date during runtime.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue