From 789eddbdee299f496c01a6c885d2db84dfebde16 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 12 Aug 2019 14:23:53 +0200 Subject: [PATCH] Add missing typing CURA-6702 --- cura/MultiplyObjectsJob.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cura/MultiplyObjectsJob.py b/cura/MultiplyObjectsJob.py index e71bbf6668..2b7454758b 100644 --- a/cura/MultiplyObjectsJob.py +++ b/cura/MultiplyObjectsJob.py @@ -2,10 +2,12 @@ # Cura is released under the terms of the LGPLv3 or higher. import copy +from typing import List from UM.Job import Job from UM.Operations.GroupedOperation import GroupedOperation from UM.Message import Message +from UM.Scene.SceneNode import SceneNode from UM.i18n import i18nCatalog i18n_catalog = i18nCatalog("cura") @@ -23,7 +25,7 @@ class MultiplyObjectsJob(Job): self._count = count self._min_offset = min_offset - def run(self): + def run(self) -> None: status_message = Message(i18n_catalog.i18nc("@info:status", "Multiplying and placing objects"), lifetime=0, dismissable=False, progress=0, title = i18n_catalog.i18nc("@info:title", "Placing Objects")) status_message.show() @@ -33,13 +35,15 @@ class MultiplyObjectsJob(Job): current_progress = 0 global_container_stack = Application.getInstance().getGlobalContainerStack() + if global_container_stack is None: + return # We can't do anything in this case. machine_width = global_container_stack.getProperty("machine_width", "value") machine_depth = global_container_stack.getProperty("machine_depth", "value") root = scene.getRoot() scale = 0.5 arranger = Arrange.create(x = machine_width, y = machine_depth, scene_root = root, scale = scale, min_offset = self._min_offset) - processed_nodes = [] + processed_nodes = [] # type: List[SceneNode] nodes = [] not_fit_count = 0