Adjust to `trio>=0.34.0` invalid `Event` truthy checks
parent
eb0514c3a8
commit
63ae23aa4f
|
|
@ -1831,7 +1831,7 @@ class MethodProxy:
|
||||||
|
|
||||||
ev = self.event_table.get(pattern)
|
ev = self.event_table.get(pattern)
|
||||||
|
|
||||||
if not ev or ev.is_set():
|
if ev is None or ev.is_set():
|
||||||
# print(f'inserting new data reset event item')
|
# print(f'inserting new data reset event item')
|
||||||
ev = self.event_table[pattern] = trio.Event()
|
ev = self.event_table[pattern] = trio.Event()
|
||||||
|
|
||||||
|
|
@ -1953,7 +1953,7 @@ async def relay_client_proxy_messages(
|
||||||
reason = status_msg['reason']
|
reason = status_msg['reason']
|
||||||
event = proxy.event_table.pop(reason, None)
|
event = proxy.event_table.pop(reason, None)
|
||||||
if (
|
if (
|
||||||
event
|
event is not None
|
||||||
and
|
and
|
||||||
event.statistics().tasks_waiting
|
event.statistics().tasks_waiting
|
||||||
):
|
):
|
||||||
|
|
|
||||||
|
|
@ -323,7 +323,7 @@ async def _reconnect_forever(
|
||||||
# if wrapper cancelled us, we expect it to also
|
# if wrapper cancelled us, we expect it to also
|
||||||
# have re-assigned a new event
|
# have re-assigned a new event
|
||||||
assert (
|
assert (
|
||||||
nobsws._connected
|
nobsws._connected is not None
|
||||||
and not nobsws._connected.is_set()
|
and not nobsws._connected.is_set()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -569,7 +569,7 @@ async def graphics_update_loop(
|
||||||
continue
|
continue
|
||||||
|
|
||||||
ic = fast_chart.view._in_interact
|
ic = fast_chart.view._in_interact
|
||||||
if ic:
|
if ic is not None:
|
||||||
fast_chart.pause_all_feeds()
|
fast_chart.pause_all_feeds()
|
||||||
log.debug(
|
log.debug(
|
||||||
f'Pausing chart updaates during interaction\n'
|
f'Pausing chart updaates during interaction\n'
|
||||||
|
|
|
||||||
|
|
@ -639,7 +639,7 @@ class ChartView(ViewBox):
|
||||||
self.order_mode: bool = False
|
self.order_mode: bool = False
|
||||||
|
|
||||||
self.setFocusPolicy(QtCore.Qt.StrongFocus)
|
self.setFocusPolicy(QtCore.Qt.StrongFocus)
|
||||||
self._in_interact: trio.Event | None = None
|
self._in_interact: trio.Event|None = None
|
||||||
self._interact_stack: ExitStack = ExitStack()
|
self._interact_stack: ExitStack = ExitStack()
|
||||||
|
|
||||||
# TODO: probably just assign this whenever a new `PlotItem` is
|
# TODO: probably just assign this whenever a new `PlotItem` is
|
||||||
|
|
@ -677,7 +677,7 @@ class ChartView(ViewBox):
|
||||||
to any waiters.
|
to any waiters.
|
||||||
|
|
||||||
'''
|
'''
|
||||||
if self._in_interact:
|
if self._in_interact is not None:
|
||||||
try:
|
try:
|
||||||
self._interact_stack.close()
|
self._interact_stack.close()
|
||||||
self.chart.resume_all_feeds()
|
self.chart.resume_all_feeds()
|
||||||
|
|
@ -1212,7 +1212,7 @@ class ChartView(ViewBox):
|
||||||
str,
|
str,
|
||||||
tuple[float, float],
|
tuple[float, float],
|
||||||
] | None = None,
|
] | None = None,
|
||||||
|
|
||||||
):
|
):
|
||||||
profiler = Profiler(
|
profiler = Profiler(
|
||||||
msg=f'ChartView.interact_graphics_cycle() for {self.name}',
|
msg=f'ChartView.interact_graphics_cycle() for {self.name}',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue