fix: as many ruff errors as possible, some type
CI / lint (pull_request) Failing after 33s
CI / test (3.11) (pull_request) Skipped
CI / test (3.12) (pull_request) Skipped
CI / test (3.13) (pull_request) Skipped
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Skipped
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Skipped
CI / test-with-coverage (pull_request) Skipped

This commit is contained in:
perl_d committed 2026-08-03 09:27:40 +02:00
1 parent f63107a1e0
commit 0135129c89
72 files changed
+647 -449

No files matched your search

+13 -5
View File
@@ -4,6 +4,7 @@ import time
from dataclasses import dataclass
from typing import Any
from aarecommon.config.logger import setup_logger
from PySide6.QtCore import (
Property,
QEasingCurve,
@@ -17,6 +18,7 @@ from PySide6.QtCore import (
from PySide6.QtGui import QColor, QPainter, QPen
from PySide6.QtWidgets import QLabel, QPushButton, QWidget
from aare.gui.constants import LOGGER_NAME
from aare.gui.tutorials.tutorial_models import (
StepFlow,
StepStatus,
@@ -36,6 +38,8 @@ from aare.gui.tutorials.tutorial_runtime import (
ensure_step_runtime_state,
)
logger = setup_logger(LOGGER_NAME)
def _now_ms() -> int:
return int(time.time() * 1000)
@@ -169,11 +173,14 @@ class TutorialOverlay(QWidget):
super().keyPressEvent(event)
def mousePressEvent(self, event) -> None:
if self._waiting_for_click and self.current_rect.isValid():
if self.current_rect.contains(event.pos()):
self.highlight_clicked.emit()
event.accept()
return
if (
self._waiting_for_click
and self.current_rect.isValid()
and self.current_rect.contains(event.pos())
):
self.highlight_clicked.emit()
event.accept()
return
super().mousePressEvent(event)
def paintEvent(self, event) -> None:
@@ -534,6 +541,7 @@ class TutorialManager(QObject):
try:
return self.target_resolver.resolve_target(step.target, self.context)
except Exception:
logger.debug("Could not resolve the tutorial step target", exc_info=True)
return None
def _resolved_target_rect(self, resolved: ResolvedTutorialTarget | None) -> QRect | None: