From 2471ce446e1c4a3899000693471488f895d98703 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 19 May 2021 08:36:40 -0400 Subject: [PATCH] Require `.` format to cli --- piker/ui/_chart.py | 4 +++- piker/ui/cli.py | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/piker/ui/_chart.py b/piker/ui/_chart.py index 427add22..32743cfb 100644 --- a/piker/ui/_chart.py +++ b/piker/ui/_chart.py @@ -1638,8 +1638,10 @@ async def _async_main( ) chart_app.search = search + symbol, _, provider = sym.rpartition('.') + # this internally starts a ``chart_symbol()`` task above - chart_app.load_symbol(brokernames[0], sym, loglevel) + chart_app.load_symbol(provider, symbol, loglevel) # TODO: seems like our incentive for brokerd caching lelel backends = {} diff --git a/piker/ui/cli.py b/piker/ui/cli.py index b674acfe..e65bc379 100644 --- a/piker/ui/cli.py +++ b/piker/ui/cli.py @@ -138,6 +138,13 @@ def chart(config, symbol, profile, pdb): from .. import _profile from ._chart import _main + if '.' not in symbol: + click.echo(click.style( + f'symbol: {symbol} must have a {symbol}. suffix', + fg='red', + )) + return + # toggle to enable profiling _profile._pg_profile = profile