From 9e92a186ec07881ec49e35f030e7b9b0c5717622 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 21 Mar 2019 09:06:41 +0100 Subject: [PATCH] Fix code styles --- cura/UI/GlobalStacksModel.py | 2 -- cura/UI/MaterialOutputModel.py | 2 +- cura/UI/ObjectsModel.py | 5 +++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cura/UI/GlobalStacksModel.py b/cura/UI/GlobalStacksModel.py index 579555e52c..f15fe1878b 100644 --- a/cura/UI/GlobalStacksModel.py +++ b/cura/UI/GlobalStacksModel.py @@ -29,7 +29,6 @@ class GlobalStacksModel(ListModel): self.addRoleName(self.HasRemoteConnectionRole, "hasRemoteConnection") self.addRoleName(self.MetaDataRole, "metadata") self.addRoleName(self.DiscoverySourceRole, "discoverySource") - self._container_stacks = [] self._change_timer = QTimer() self._change_timer.setInterval(200) @@ -40,7 +39,6 @@ class GlobalStacksModel(ListModel): CuraContainerRegistry.getInstance().containerAdded.connect(self._onContainerChanged) CuraContainerRegistry.getInstance().containerMetaDataChanged.connect(self._onContainerChanged) CuraContainerRegistry.getInstance().containerRemoved.connect(self._onContainerChanged) - self._filter_dict = {} self._updateDelayed() ## Handler for container added/removed events from registry diff --git a/cura/UI/MaterialOutputModel.py b/cura/UI/MaterialOutputModel.py index b3dd83fb72..0ac4cf36bc 100644 --- a/cura/UI/MaterialOutputModel.py +++ b/cura/UI/MaterialOutputModel.py @@ -5,7 +5,7 @@ from PyQt5.QtCore import pyqtProperty, QObject class MaterialOutputModel(QObject): - def __init__(self, guid: str, type: str, color: str, brand: str, name: str, parent = None): + def __init__(self, guid: str, type: str, color: str, brand: str, name: str, parent = None) -> None: super().__init__(parent) self._guid = guid self._type = type diff --git a/cura/UI/ObjectsModel.py b/cura/UI/ObjectsModel.py index 4d0233f6cb..09304451a5 100644 --- a/cura/UI/ObjectsModel.py +++ b/cura/UI/ObjectsModel.py @@ -2,6 +2,7 @@ # Cura is released under the terms of the LGPLv3 or higher. from collections import defaultdict +from typing import Dict from PyQt5.QtCore import QTimer @@ -18,7 +19,7 @@ catalog = i18nCatalog("cura") ## Keep track of all objects in the project class ObjectsModel(ListModel): - def __init__(self): + def __init__(self) -> None: super().__init__() Application.getInstance().getController().getScene().sceneChanged.connect(self._updateSceneDelayed) @@ -48,7 +49,7 @@ class ObjectsModel(ListModel): filter_current_build_plate = Application.getInstance().getPreferences().getValue("view/filter_current_build_plate") active_build_plate_number = self._build_plate_number group_nr = 1 - name_count_dict = defaultdict(int) + name_count_dict = defaultdict(int) # type: Dict[str, int] for node in DepthFirstIterator(Application.getInstance().getController().getScene().getRoot()): if not isinstance(node, SceneNode):