Skip to content

Commit

Permalink
Formatting files and dealing with other Pylance problems
Browse files Browse the repository at this point in the history
  • Loading branch information
mmouchous-ledger committed Nov 27, 2024
1 parent 2a8de97 commit 4408f02
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
6 changes: 3 additions & 3 deletions laserstudio/widgets/marker.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def color(self, value: Union[QColor, Qt.GlobalColor, int]):
def qfillcolor(self) -> QColor:
""":return: Current fill color, as QColor."""
return QColor(self.__fillcolor)

@property
def fillcolor(self):
""":return: Current fill color, as QColor."""
Expand Down Expand Up @@ -138,8 +138,8 @@ def update_pos(self):
else:
self.setVisible(False)

def setToolTip(self, value: str):
self.__ellipse.setToolTip(value)
def setToolTip(self, toolTip: Optional[str]):
self.__ellipse.setToolTip(toolTip)


class IdMarker(Marker):
Expand Down
13 changes: 9 additions & 4 deletions laserstudio/widgets/scangeometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,14 @@ def __update(self):
)
else:
for poly in self.__scan_geometry.geoms:
self.__scan_zones_group.addToGroup(
ScanGeometry.__poly_to_path_item(poly)
)
if isinstance(poly, Polygon):
self.__scan_zones_group.addToGroup(
ScanGeometry.__poly_to_path_item(poly)
)
else:
logging.getLogger("laserstudio").error(
"Unsupported geometry type in scan geometry."
)
self.addToGroup(self.__scan_zones_group)

# Also, update the scan path with the new geometry
Expand Down Expand Up @@ -146,7 +151,7 @@ def density(self, value: int):

@staticmethod
def shapely_to_yaml(
geometry: Union[Polygon, MultiPolygon, GeometryCollection]
geometry: Union[Polygon, MultiPolygon, GeometryCollection],
) -> dict:
"""
:return: A dict for YAML serialization.
Expand Down
2 changes: 1 addition & 1 deletion laserstudio/widgets/toolbars/markerstoolbar.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from PyQt6.QtCore import Qt, QSize
from PyQt6.QtGui import QIcon
from PyQt6.QtWidgets import QToolBar, QPushButton, QMainWindow
from PyQt6.QtWidgets import QToolBar, QPushButton
from ..return_line_edit import ReturnSpinBox
from ...utils.util import colored_image
from ..viewer import Viewer
Expand Down

0 comments on commit 4408f02

Please sign in to comment.