IntentNode.py 758 B

1234567891011121314151617181920212223
  1. # Copyright (c) 2019 Ultimaker B.V.
  2. # Cura is released under the terms of the LGPLv3 or higher.
  3. from typing import TYPE_CHECKING
  4. from UM.Settings.ContainerRegistry import ContainerRegistry
  5. from cura.Machines.ContainerNode import ContainerNode
  6. if TYPE_CHECKING:
  7. from cura.Machines.QualityNode import QualityNode
  8. class IntentNode(ContainerNode):
  9. """This class represents an intent profile in the container tree.
  10. This class has no more subnodes.
  11. """
  12. def __init__(self, container_id: str, quality: "QualityNode") -> None:
  13. super().__init__(container_id)
  14. self.quality = quality
  15. self.intent_category = ContainerRegistry.getInstance().findContainersMetadata(id = container_id)[0].get("intent_category", "default")