mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
CURA-5330 Fix typing and code-style in the ContainerNode and all the
related children, and QualityGroup and its children. Also fix the related calls in the managers.
This commit is contained in:
parent
f860b9c99e
commit
6e364f0895
10 changed files with 44 additions and 34 deletions
|
|
@ -23,10 +23,10 @@ from UM.Settings.InstanceContainer import InstanceContainer
|
|||
class ContainerNode:
|
||||
__slots__ = ("metadata", "container", "children_map")
|
||||
|
||||
def __init__(self, metadata: Optional[Dict[str, Any]] = None):
|
||||
def __init__(self, metadata: Optional[Dict[str, Any]] = None) -> None:
|
||||
self.metadata = metadata
|
||||
self.container = None
|
||||
self.children_map = OrderedDict()
|
||||
self.children_map = OrderedDict() #type: OrderedDict[str, ContainerNode]
|
||||
|
||||
## Get an entry value from the metadata
|
||||
def getMetaDataEntry(self, entry: str, default: Any = None) -> Any:
|
||||
|
|
@ -56,4 +56,4 @@ class ContainerNode:
|
|||
return self.container
|
||||
|
||||
def __str__(self) -> str:
|
||||
return "%s[%s]" % (self.__class__.__name__, self.metadata.get("id"))
|
||||
return "%s[%s]" % (self.__class__.__name__, self.getMetaDataEntry("id"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue