diff options
author | Jaime van Kessel <nallath@gmail.com> | 2019-08-12 15:23:53 +0300 |
---|---|---|
committer | Jaime van Kessel <nallath@gmail.com> | 2019-08-12 15:23:53 +0300 |
commit | 789eddbdee299f496c01a6c885d2db84dfebde16 (patch) | |
tree | 4ac86618fa22f98b78500e204525f4be35a36798 /cura/MultiplyObjectsJob.py | |
parent | 5bc7ddf3eedb850f5bb04d1adf66f5930ea82f2b (diff) |
Add missing typing
CURA-6702
Diffstat (limited to 'cura/MultiplyObjectsJob.py')
-rw-r--r-- | cura/MultiplyObjectsJob.py | 8 |
1 files 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 |