style: declare HoverableButton state attribute for the pyright gate
CI / lint (push) Skipped
CI / test (3.11) (push) Skipped
CI / test (3.12) (push) Skipped
CI / test (3.13) (push) Skipped
CI / test-with-beamline-plugins (pxi_bec) (push) Skipped
CI / test-with-beamline-plugins (pxii_bec) (push) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (push) Skipped
CI / test (3.13) (pull_request) Successful in 40s
CI / test (3.11) (pull_request) Successful in 1m26s
CI / test (3.12) (pull_request) Successful in 1m40s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Successful in 1m47s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Successful in 1m44s
CI / lint (pull_request) Successful in 3m33s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Successful in 3m50s
CI / test-with-coverage (pull_request) Successful in 4m3s
CI / coverage-analysis (pull_request) Successful in 3s

The dynamic _beamline_state assignment was a pre-existing pattern, but
the panel rewrite turned its line into a changed line, so the
basedpyright diff gate now counts it. Declare the attribute instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-06 18:45:37 +02:00
co-authored by Claude Fable 5
parent 5948b51c80
commit 5ec85b6844
+4 -1
View File
@@ -63,8 +63,11 @@ class HoverableButton(QPushButton):
hovered = Signal(object)
unhovered = Signal()
# Set by the panel right after construction; carried in hover signals.
_beamline_state: BeamlineStateEnum | None = None
def enterEvent(self, event) -> None:
self.hovered.emit(getattr(self, "_beamline_state", None))
self.hovered.emit(self._beamline_state)
super().enterEvent(event)
def leaveEvent(self, event) -> None: