Browse Source

Fix final set of typing issues

Jaime van Kessel 3 years ago
parent
commit
d49a90029f

+ 2 - 2
cura/OAuth2/KeyringAttribute.py

@@ -30,7 +30,7 @@ class KeyringAttribute:
     """
     Descriptor for attributes that need to be stored in the keyring. With Fallback behaviour to the preference cfg file
     """
-    def __get__(self, instance: BaseModel, owner: type) -> str:
+    def __get__(self, instance: "BaseModel", owner: type) -> str:
         if self._store_secure:
             try:
                 value = keyring.get_password("cura", self._keyring_name)
@@ -42,7 +42,7 @@ class KeyringAttribute:
         else:
             return getattr(instance, self._name)
 
-    def __set__(self, instance: BaseModel, value: str):
+    def __set__(self, instance: "BaseModel", value: str):
         if self._store_secure:
             setattr(instance, self._name, None)
             try:

+ 6 - 6
plugins/TrimeshReader/TrimeshReader.py

@@ -145,22 +145,22 @@ class TrimeshReader(MeshReader):
         tri_faces = tri_node.faces
         tri_vertices = tri_node.vertices
 
-        indices = []
-        vertices = []
+        indices_list = []
+        vertices_list = []
 
         index_count = 0
         face_count = 0
         for tri_face in tri_faces:
             face = []
             for tri_index in tri_face:
-                vertices.append(tri_vertices[tri_index])
+                vertices_list.append(tri_vertices[tri_index])
                 face.append(index_count)
                 index_count += 1
-            indices.append(face)
+            indices_list.append(face)
             face_count += 1
 
-        vertices = numpy.asarray(vertices, dtype = numpy.float32)
-        indices = numpy.asarray(indices, dtype = numpy.int32)
+        vertices = numpy.asarray(vertices_list, dtype = numpy.float32)
+        indices = numpy.asarray(indices_list, dtype = numpy.int32)
         normals = calculateNormalsFromIndexedVertices(vertices, indices, face_count)
 
         mesh_data = MeshData(vertices = vertices, indices = indices, normals = normals, file_name = file_name)

+ 1 - 1
plugins/VersionUpgrade/VersionUpgrade48to49/VersionUpgrade48to49.py

@@ -102,7 +102,7 @@ class VersionUpgrade48to49(VersionUpgrade):
         if "shell" in parser:
             for setting in parser["shell"]:
                 if setting in self._moved_visibility_settings:
-                    parser["top_bottom"][setting] = None
+                    parser["top_bottom"][setting] = None  # type: ignore
                     del parser["shell"][setting]
 
         result = io.StringIO()