Codestyle fixes

This commit is contained in:
Jaime van Kessel 2020-01-10 15:32:53 +01:00
parent 49211d3233
commit bb52ba6848
No known key found for this signature in database
GPG Key ID: 3710727397403C91
4 changed files with 11 additions and 13 deletions

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -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)
return QImage(), QSize(15, 15)
return QImage(), QSize(15, 15)