Remove deprecated getChildNode and getContainer in ContainerNode

CURA-6858
This commit is contained in:
Lipu Fei 2019-10-22 13:58:31 +02:00
parent 43ee68bdc7
commit 9c92e61699

View file

@ -7,7 +7,7 @@ from UM.ConfigurationErrorMessage import ConfigurationErrorMessage
from UM.Settings.ContainerRegistry import ContainerRegistry from UM.Settings.ContainerRegistry import ContainerRegistry
from UM.Logger import Logger from UM.Logger import Logger
from UM.Settings.InstanceContainer import InstanceContainer from UM.Settings.InstanceContainer import InstanceContainer
from UM.Decorators import deprecated
## A node in the container tree. It represents one container. ## A node in the container tree. It represents one container.
# #
@ -43,18 +43,6 @@ class ContainerNode:
return default return default
return container_metadata[0].get(entry, default) return container_metadata[0].get(entry, default)
## Get the child with the specified container ID.
# \param child_id The container ID to get from among the children.
# \return The child node, or ``None`` if no child is present with the
# specified ID.
@deprecated("Iterate over the children instead of requesting them one by one.", "4.3")
def getChildNode(self, child_id: str) -> Optional["ContainerNode"]:
return self.children_map.get(child_id)
@deprecated("Use `.container` instead.", "4.3")
def getContainer(self) -> Optional[InstanceContainer]:
return self.container
## The container that this node's container ID refers to. ## The container that this node's container ID refers to.
# #
# This can be used to finally instantiate the container in order to put it # This can be used to finally instantiate the container in order to put it