From 81b33b864959610ea5a367d3149706d35ca499e2 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 10 Jan 2020 14:25:35 +0100 Subject: Add some missing typing --- cura/CuraPackageManager.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'cura/CuraPackageManager.py') diff --git a/cura/CuraPackageManager.py b/cura/CuraPackageManager.py index 6422469bdf..99f2072644 100644 --- a/cura/CuraPackageManager.py +++ b/cura/CuraPackageManager.py @@ -1,7 +1,7 @@ # Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. -from typing import List, Tuple +from typing import List, Tuple, TYPE_CHECKING, Optional from cura.CuraApplication import CuraApplication #To find some resource types. from cura.Settings.GlobalStack import GlobalStack @@ -9,12 +9,16 @@ from cura.Settings.GlobalStack import GlobalStack from UM.PackageManager import PackageManager #The class we're extending. from UM.Resources import Resources #To find storage paths for some resource types. +if TYPE_CHECKING: + from UM.Qt.QtApplication import QtApplication + from PyQt5.QtCore import QObject + class CuraPackageManager(PackageManager): - def __init__(self, application, parent = None): + def __init__(self, application: "QtApplication", parent: Optional["QObject"] = None): super().__init__(application, parent) - def initialize(self): + def initialize(self) -> None: self._installation_dirs_dict["materials"] = Resources.getStoragePath(CuraApplication.ResourceTypes.MaterialInstanceContainer) self._installation_dirs_dict["qualities"] = Resources.getStoragePath(CuraApplication.ResourceTypes.QualityInstanceContainer) -- cgit v1.2.3