Adjust cli to new api

kivy_mainline_and_py3.8
Tyler Goodlet 2018-02-08 19:15:21 -05:00
parent 224451f44a
commit 17c4ac3b8c
1 changed files with 3 additions and 4 deletions

View File

@ -75,19 +75,18 @@ def quote(loglevel, broker, tickers, df_output):
"""client for testing broker API methods with pretty printing of output.
"""
brokermod = import_module('.' + broker, 'piker.brokers')
data = run(partial(brokermod.quote, tickers), loglevel=loglevel)
quotes = data['quotes']
quotes = run(partial(brokermod.quote, tickers), loglevel=loglevel)
cols = quotes[0].copy()
cols.pop('symbol')
if df_output:
df = pd.DataFrame(
data['quotes'],
quotes,
index=[item['symbol'] for item in quotes],
columns=cols,
)
click.echo(df)
else:
click.echo(colorize_json(data))
click.echo(colorize_json(quotes))
@cli.command()