From 7f91cda899d7c01fa25a639405527481d34c511c Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sat, 11 Feb 2023 15:55:48 -0500 Subject: [PATCH] Add hack-zone UI REPL access via `ctl-u` --- piker/ui/_interaction.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/piker/ui/_interaction.py b/piker/ui/_interaction.py index 7682b8f7..4f4490ca 100644 --- a/piker/ui/_interaction.py +++ b/piker/ui/_interaction.py @@ -79,7 +79,7 @@ ORDER_MODE = { async def handle_viewmode_kb_inputs( - view: 'ChartView', + view: ChartView, recv_chan: trio.abc.ReceiveChannel, ) -> None: @@ -148,6 +148,20 @@ async def handle_viewmode_kb_inputs( if mods == Qt.ControlModifier: ctrl = True + # UI REPL-shell + if ( + ctrl and key in { + Qt.Key_U, + } + ): + import tractor + god = order_mode.godw + feed = order_mode.feed + chart = order_mode.chart + vlm_chart = chart.linked.subplots['volume'] + dvlm_pi = vlm_chart._vizs['dolla_vlm'].plot + await tractor.breakpoint() + # SEARCH MODE # # ctlr-/ for "lookup", "search" -> open search tree if ( @@ -319,7 +333,7 @@ async def handle_viewmode_kb_inputs( async def handle_viewmode_mouse( - view: 'ChartView', + view: ChartView, recv_chan: trio.abc.ReceiveChannel, ) -> None: