diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index e9ed1bf978..d479b0fe18 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -15,7 +15,7 @@ from PyQt5.QtQml import qmlRegisterUncreatableType, qmlRegisterSingletonType, qm from UM.i18n import i18nCatalog from UM.Application import Application -from UM.Decorators import override, deprecated +from UM.Decorators import override from UM.FlameProfiler import pyqtSlot from UM.Logger import Logger from UM.Message import Message @@ -1870,16 +1870,14 @@ class CuraApplication(QtApplication): main_window = QtApplication.getInstance().getMainWindow() if main_window: return main_window.width() - else: - return 0 + return 0 @pyqtSlot(result = int) def appHeight(self) -> int: main_window = QtApplication.getInstance().getMainWindow() if main_window: return main_window.height() - else: - return 0 + return 0 @pyqtSlot() def deleteAll(self, only_selectable: bool = True) -> None: diff --git a/cura/LayerData.py b/cura/LayerData.py index 796e71cbdc..72824591ab 100644 --- a/cura/LayerData.py +++ b/cura/LayerData.py @@ -16,8 +16,7 @@ class LayerData(MeshData): def getLayer(self, layer): if layer in self._layers: return self._layers[layer] - else: - return None + return None def getLayers(self): return self._layers diff --git a/cura/LayerPolygon.py b/cura/LayerPolygon.py index ca752e35ee..353d195100 100644 --- a/cura/LayerPolygon.py +++ b/cura/LayerPolygon.py @@ -61,7 +61,7 @@ class LayerPolygon: # When type is used as index returns true if type == LayerPolygon.InfillType or type == LayerPolygon.SkinType or type == LayerPolygon.SupportInfillType # Should be generated in better way, not hardcoded. - self._isInfillOrSkinTypeMap = numpy.array([0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0], dtype = numpy.bool) + self._is_infill_or_skin_type_map = numpy.array([0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0], dtype = numpy.bool) self._build_cache_line_mesh_mask = None # type: Optional[numpy.ndarray] self._build_cache_needed_points = None # type: Optional[numpy.ndarray] @@ -153,7 +153,7 @@ class LayerPolygon: return self._color_map[line_types] def isInfillOrSkinType(self, line_types: numpy.ndarray) -> numpy.ndarray: - return self._isInfillOrSkinTypeMap[line_types] + return self._is_infill_or_skin_type_map[line_types] def lineMeshVertexCount(self) -> int: return self._vertex_end - self._vertex_begin diff --git a/cura/PrintJobPreviewImageProvider.py b/cura/PrintJobPreviewImageProvider.py index a8df5aa273..8b46c6db37 100644 --- a/cura/PrintJobPreviewImageProvider.py +++ b/cura/PrintJobPreviewImageProvider.py @@ -3,6 +3,7 @@ from PyQt5.QtQuick import QQuickImageProvider from PyQt5.QtCore import QSize from UM.Application import Application +from typing import Tuple class PrintJobPreviewImageProvider(QQuickImageProvider): @@ -10,7 +11,7 @@ class PrintJobPreviewImageProvider(QQuickImageProvider): super().__init__(QQuickImageProvider.Image) ## Request a new image. - def requestImage(self, id: str, size: QSize) -> QImage: + def requestImage(self, id: str, size: QSize) -> Tuple[QImage, QSize]: # The id will have an uuid and an increment separated by a slash. As we don't care about the value of the # increment, we need to strip that first. uuid = id[id.find("/") + 1:] @@ -22,6 +23,6 @@ class PrintJobPreviewImageProvider(QQuickImageProvider): if print_job.key == uuid: if print_job.getPreviewImage(): return print_job.getPreviewImage(), QSize(15, 15) - else: - return QImage(), QSize(15, 15) - return QImage(), QSize(15,15) \ No newline at end of file + + return QImage(), QSize(15, 15) + return QImage(), QSize(15, 15) \ No newline at end of file