Browse Source

Fix code styles

Lipu Fei 6 years ago
parent
commit
9e92a186ec
3 changed files with 4 additions and 5 deletions
  1. 0 2
      cura/UI/GlobalStacksModel.py
  2. 1 1
      cura/UI/MaterialOutputModel.py
  3. 3 2
      cura/UI/ObjectsModel.py

+ 0 - 2
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

+ 1 - 1
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

+ 3 - 2
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):