diff options
author | Jack Ha <jackha@gmail.com> | 2018-07-12 15:06:34 +0300 |
---|---|---|
committer | Jack Ha <jackha@gmail.com> | 2018-07-12 15:06:34 +0300 |
commit | 2bd8350141439814d92827ef67243c93f3d70872 (patch) | |
tree | 7d531cb516fa06518d57fa28d19228c85354aeba /cura/CuraPackageManager.py | |
parent | af02dc2758b8eec1f3c3ccc2b96c5cb9bdc5276a (diff) |
Added error checking, added typing, renamed function. CURA-5389
Diffstat (limited to 'cura/CuraPackageManager.py')
-rw-r--r-- | cura/CuraPackageManager.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cura/CuraPackageManager.py b/cura/CuraPackageManager.py index 363b8034ec..6422469bdf 100644 --- a/cura/CuraPackageManager.py +++ b/cura/CuraPackageManager.py @@ -1,6 +1,8 @@ # Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. +from typing import List, Tuple + from cura.CuraApplication import CuraApplication #To find some resource types. from cura.Settings.GlobalStack import GlobalStack @@ -22,7 +24,7 @@ class CuraPackageManager(PackageManager): # empty if it is never used. # It loops through all the package contents and see if some of the ids are used. # The list consists of 3-tuples: (global_stack, extruder_nr, container_id) - def getMachinesUsingPackage(self, package_id: str): + def getMachinesUsingPackage(self, package_id: str) -> Tuple[List[Tuple[GlobalStack, str, str]], List[Tuple[GlobalStack, str, str]]]: ids = self.getPackageContainerIds(package_id) container_stacks = self._application.getContainerRegistry().findContainerStacks() global_stacks = [container_stack for container_stack in container_stacks if isinstance(container_stack, GlobalStack)] |