From 68ddf443a1eb9bb1065a123c68619d77388fd2c2 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 4 Jun 2018 12:58:56 +0200 Subject: [PATCH 1/3] Use explicit key-word arguments instead of kwargs Makes it easier to use, and better self-documenting. Contributes to issue CURA-5330. --- cura/Scene/CuraSceneNode.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cura/Scene/CuraSceneNode.py b/cura/Scene/CuraSceneNode.py index 428a59f554..9e641b5b68 100644 --- a/cura/Scene/CuraSceneNode.py +++ b/cura/Scene/CuraSceneNode.py @@ -13,9 +13,9 @@ from cura.Settings.SettingOverrideDecorator import SettingOverrideDecorator ## Scene nodes that are models are only seen when selecting the corresponding build plate # Note that many other nodes can just be UM SceneNode objects. class CuraSceneNode(SceneNode): - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - if "no_setting_override" not in kwargs: + def __init__(self, parent: Optional["SceneNode"] = None, visible: bool = True, name: str = "", no_settings_override: bool = False): + super().__init__(parent = parent, visible = visible, name = name) + if not "no_setting_override": self.addDecorator(SettingOverrideDecorator()) # now we always have a getActiveExtruderPosition, unless explicitly disabled self._outside_buildarea = False From 360d4f14e4c4e235645eaa4720ead23f5fd2ec3d Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 4 Jun 2018 12:59:44 +0200 Subject: [PATCH 2/3] Fix broken import Oops. Contributes to issue CURA-5330. --- cura/Scene/CuraSceneNode.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Scene/CuraSceneNode.py b/cura/Scene/CuraSceneNode.py index 9e641b5b68..651eef9efc 100644 --- a/cura/Scene/CuraSceneNode.py +++ b/cura/Scene/CuraSceneNode.py @@ -1,7 +1,7 @@ # Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from copy import deepcopy -from typing import List +from typing import List, Optional from UM.Application import Application from UM.Math.AxisAlignedBox import AxisAlignedBox From 258a90d8507f7e83eaa0ebc1fab588c96001b6a6 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 4 Jun 2018 13:00:57 +0200 Subject: [PATCH 3/3] Fix parameter Oops again. I should not do this when I have 30 seconds left on the clock. Contributes to issue CURA-5330. --- cura/Scene/CuraSceneNode.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/Scene/CuraSceneNode.py b/cura/Scene/CuraSceneNode.py index 651eef9efc..92f1d839fb 100644 --- a/cura/Scene/CuraSceneNode.py +++ b/cura/Scene/CuraSceneNode.py @@ -13,9 +13,9 @@ from cura.Settings.SettingOverrideDecorator import SettingOverrideDecorator ## Scene nodes that are models are only seen when selecting the corresponding build plate # Note that many other nodes can just be UM SceneNode objects. class CuraSceneNode(SceneNode): - def __init__(self, parent: Optional["SceneNode"] = None, visible: bool = True, name: str = "", no_settings_override: bool = False): + def __init__(self, parent: Optional["SceneNode"] = None, visible: bool = True, name: str = "", no_setting_override: bool = False): super().__init__(parent = parent, visible = visible, name = name) - if not "no_setting_override": + if not no_setting_override: self.addDecorator(SettingOverrideDecorator()) # now we always have a getActiveExtruderPosition, unless explicitly disabled self._outside_buildarea = False