File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ classifiers = [
4848dynamic = [" version" ]
4949dependencies = [
5050 ' fonticon-materialdesignicons6' ,
51- ' pymmcore-plus[cli] >=0.9.0 ' ,
51+ ' pymmcore-plus[cli] >=0.10.2 ' ,
5252 ' qtpy >=2.0' ,
5353 ' superqt[quantity] >=0.5.3' ,
5454 ' useq-schema >=0.4.7' ,
Original file line number Diff line number Diff line change 22
33import re
44from pathlib import Path
5- from typing import ContextManager , Sequence
5+ from typing import Any , ContextManager , Sequence
66
77import useq
8+ from psygnal import SignalInstance
89from pymmcore_plus import CMMCorePlus
9- from pymmcore_plus . core . events import CMMCoreSignaler , PCoreSignaler
10+ from qtpy . QtCore import QObject
1011from qtpy .QtWidgets import (
1112 QComboBox ,
1213 QDialog ,
@@ -87,12 +88,13 @@ def guess_objective_or_prompt(
8788 return None
8889
8990
90- def block_core (mmcore_events : CMMCoreSignaler | PCoreSignaler ) -> ContextManager :
91+ def block_core (obj : Any ) -> ContextManager :
9192 """Block core signals."""
92- if isinstance (mmcore_events , CMMCoreSignaler ):
93- return mmcore_events .blocked () # type: ignore
94- elif isinstance (mmcore_events , PCoreSignaler ):
95- return signals_blocked (mmcore_events ) # type: ignore
93+ if isinstance (obj , QObject ):
94+ return signals_blocked (obj ) # type: ignore [no-any-return]
95+ if isinstance (obj , SignalInstance ):
96+ return obj .blocked ()
97+ raise TypeError (f"Cannot block signals for { obj } " )
9698
9799
98100def cast_grid_plan (
You can’t perform that action at this time.
0 commit comments