From b670af484c37b78788f467d368ee7c7f2be9f63f Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 10 Jun 2020 13:48:21 -0400 Subject: [PATCH] Move UI spawning cmds to new module --- piker/brokers/cli.py | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/piker/brokers/cli.py b/piker/brokers/cli.py index b18219bf..c05be413 100644 --- a/piker/brokers/cli.py +++ b/piker/brokers/cli.py @@ -131,7 +131,6 @@ def bars(config, symbol, count, df_output): click.echo(colorize_json(bars)) - @cli.command() @click.option('--rate', '-r', default=5, help='Logging level') @click.option('--filename', '-f', default='quotestream.jsonstream', @@ -226,43 +225,3 @@ def optsquote(config, symbol, df_output, date): click.echo(df) else: click.echo(colorize_json(quotes)) - - -@cli.command() -@click.argument('tickers', nargs=-1, required=True) -@click.pass_obj -def symbol_info(config, tickers): - """Print symbol quotes to the console - """ - # global opts - brokermod = config['brokermod'] - - quotes = trio.run(partial(core.symbol_info, brokermod, tickers)) - if not quotes: - log.error(f"No quotes could be found for {tickers}?") - return - - if len(quotes) < len(tickers): - syms = tuple(map(itemgetter('symbol'), quotes)) - for ticker in tickers: - if ticker not in syms: - brokermod.log.warn(f"Could not find symbol {ticker}?") - - click.echo(colorize_json(quotes)) - - -@cli.command() -@click.argument('pattern', required=True) -@click.pass_obj -def search(config, pattern): - """Search for symbols from broker backend(s). - """ - # global opts - brokermod = config['brokermod'] - - quotes = trio.run(partial(core.symbol_search, brokermod, pattern)) - if not quotes: - log.error(f"No matches could be found for {pattern}?") - return - - click.echo(colorize_json(quotes))