diff options
author | c.lamboo <casperlamboo@gmail.com> | 2022-06-03 16:22:29 +0300 |
---|---|---|
committer | c.lamboo <casperlamboo@gmail.com> | 2022-06-03 16:22:29 +0300 |
commit | eccef62dc7818bea012069bff117bae32d6628a4 (patch) | |
tree | 76c599e0768ccaad4aaa75eb57b5423e5860ae44 /plugins | |
parent | 2230269ab3d458601fd026c7d0dd8e279d7c252e (diff) |
Add typing
CURA-6990
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/3MFReader/WorkspaceDialog.py | 8 | ||||
-rw-r--r-- | plugins/Marketplace/InstallMissingPackagesDialog.py | 8 | ||||
-rw-r--r-- | plugins/Marketplace/MissingPackageList.py | 2 | ||||
-rw-r--r-- | plugins/Marketplace/PackageModel.py | 4 |
4 files changed, 11 insertions, 11 deletions
diff --git a/plugins/3MFReader/WorkspaceDialog.py b/plugins/3MFReader/WorkspaceDialog.py index 30a2a39465..e3cbef607a 100644 --- a/plugins/3MFReader/WorkspaceDialog.py +++ b/plugins/3MFReader/WorkspaceDialog.py @@ -27,7 +27,7 @@ i18n_catalog = i18nCatalog("cura") class WorkspaceDialog(QObject): showDialogSignal = pyqtSignal() - def __init__(self, parent = None): + def __init__(self, parent = None) -> None: super().__init__(parent) self._component = None self._context = None @@ -287,11 +287,11 @@ class WorkspaceDialog(QObject): self.missingPackagesChanged.emit() @pyqtProperty("QVariantList", notify=missingPackagesChanged) - def missingPackages(self): + def missingPackages(self) -> List[Dict[str, str]]: return self._missing_package_metadata @pyqtSlot() - def installMissingPackages(self): + def installMissingPackages(self) -> None: self._install_missing_package_dialog = InstallMissingPackageDialog(self._missing_package_metadata) self._install_missing_package_dialog.show() @@ -408,7 +408,7 @@ class WorkspaceDialog(QObject): result_message.actionTriggered.connect(self._onMessageActionTriggered) result_message.show() - def _onMessageActionTriggered(self, message: Message, sync_message_action: str): + def _onMessageActionTriggered(self, message: Message, sync_message_action: str) -> None: if sync_message_action == "install_materials": self.installMissingPackages() message.hide() diff --git a/plugins/Marketplace/InstallMissingPackagesDialog.py b/plugins/Marketplace/InstallMissingPackagesDialog.py index 8ed84c1d86..3ed46959dd 100644 --- a/plugins/Marketplace/InstallMissingPackagesDialog.py +++ b/plugins/Marketplace/InstallMissingPackagesDialog.py @@ -11,7 +11,7 @@ from plugins.Marketplace.MissingPackageList import MissingPackageList class InstallMissingPackageDialog(QObject): """Dialog used to display packages that need to be installed to load 3mf file materials""" - def __init__(self, packages_metadata: List[Dict[str, str]]): + def __init__(self, packages_metadata: List[Dict[str, str]]) -> None: """Initialize :param packages_metadata: List of dictionaries containing information about missing packages. @@ -26,9 +26,9 @@ class InstallMissingPackageDialog(QObject): self._restart_needed = False self._package_metadata: List[Dict[str, str]] = packages_metadata - self._package_model = MissingPackageList(packages_metadata) + self._package_model: MissingPackageList = MissingPackageList(packages_metadata) - def show(self): + def show(self) -> None: plugin_path = self._plugin_registry.getPluginPath("Marketplace") if plugin_path is None: plugin_path = os.path.dirname(__file__) @@ -52,5 +52,5 @@ class InstallMissingPackageDialog(QObject): return self._restart_needed @pyqtProperty(QObject) - def model(self): + def model(self) -> MissingPackageList: return self._package_model diff --git a/plugins/Marketplace/MissingPackageList.py b/plugins/Marketplace/MissingPackageList.py index c979f8796c..385e78b95f 100644 --- a/plugins/Marketplace/MissingPackageList.py +++ b/plugins/Marketplace/MissingPackageList.py @@ -32,7 +32,7 @@ class MissingPackageList(RemotePackageList): if not self.hasMore: self._addPackagesMissingFromRequest() - def _addPackagesMissingFromRequest(self): + def _addPackagesMissingFromRequest(self) -> None: """Create cards for packages the user needs to install that could not be found""" returned_packages_ids = [item["package"].packageId for item in self._items] diff --git a/plugins/Marketplace/PackageModel.py b/plugins/Marketplace/PackageModel.py index 3376880ec2..21db487d8f 100644 --- a/plugins/Marketplace/PackageModel.py +++ b/plugins/Marketplace/PackageModel.py @@ -87,7 +87,7 @@ class PackageModel(QObject): self._is_missing_package_information = False @classmethod - def fromIncompletePackageInformation(cls, display_name: str, package_version: str, package_type: str): + def fromIncompletePackageInformation(cls, display_name: str, package_version: str, package_type: str) -> PackageModel: package_data = { "display_name": display_name, "package_version": package_version, @@ -402,7 +402,7 @@ class PackageModel(QObject): isMissingPackageInformationChanged = pyqtSignal() - def setIsMissingPackageInformation(self, isMissingPackageInformation: bool): + def setIsMissingPackageInformation(self, isMissingPackageInformation: bool) -> None: self._is_missing_package_information = isMissingPackageInformation self.isMissingPackageInformationChanged.emit() |