CURA-5330 Fix type checking in ContainerNodes

This commit is contained in:
Diego Prado Gesto 2018-06-13 16:10:11 +02:00
parent 803d945fb6
commit f700a39547
3 changed files with 8 additions and 5 deletions

View file

@ -1,7 +1,7 @@
# Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import Optional, Any, Dict
from typing import Optional, Any, Dict, Union, TYPE_CHECKING
from collections import OrderedDict
@ -9,6 +9,9 @@ from UM.ConfigurationErrorMessage import ConfigurationErrorMessage
from UM.Logger import Logger
from UM.Settings.InstanceContainer import InstanceContainer
if TYPE_CHECKING:
from cura.Machines.QualityGroup import QualityGroup
##
# A metadata / container combination. Use getContainer() to get the container corresponding to the metadata.
@ -26,7 +29,7 @@ class ContainerNode:
def __init__(self, metadata: Optional[Dict[str, Any]] = None) -> None:
self.metadata = metadata
self.container = None
self.children_map = OrderedDict() #type: OrderedDict[str, ContainerNode]
self.children_map = OrderedDict() #type: OrderedDict[str, Union[QualityGroup, ContainerNode]]
## Get an entry value from the metadata
def getMetaDataEntry(self, entry: str, default: Any = None) -> Any: