Fix final set of typing issues

This commit is contained in:
Jaime van Kessel 2021-04-07 14:02:29 +02:00
parent 3432720f7c
commit d49a90029f
No known key found for this signature in database
GPG key ID: 3710727397403C91
3 changed files with 9 additions and 9 deletions

View file

@ -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 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: if self._store_secure:
try: try:
value = keyring.get_password("cura", self._keyring_name) value = keyring.get_password("cura", self._keyring_name)
@ -42,7 +42,7 @@ class KeyringAttribute:
else: else:
return getattr(instance, self._name) return getattr(instance, self._name)
def __set__(self, instance: BaseModel, value: str): def __set__(self, instance: "BaseModel", value: str):
if self._store_secure: if self._store_secure:
setattr(instance, self._name, None) setattr(instance, self._name, None)
try: try:

View file

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

View file

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