Make <brokermod>.quoter() a simple factory func

kivy_mainline_and_py3.8
Tyler Goodlet 2018-04-18 01:29:33 -04:00
parent a6dc697327
commit 02a71c51ba
2 changed files with 3 additions and 5 deletions

View File

@ -284,7 +284,6 @@ async def get_client() -> Client:
write_conf(client)
@asynccontextmanager
async def quoter(client: Client, tickers: [str]):
"""Quoter context.
"""
@ -328,7 +327,7 @@ async def quoter(client: Client, tickers: [str]):
quotes[quote['symbol']] = quote
if quote.get('delay', 0) > 0:
log.warning(f"Delayed quote:\n{quote}")
log.warn(f"Delayed quote:\n{quote}")
return quotes
@ -338,7 +337,7 @@ async def quoter(client: Client, tickers: [str]):
# re-save symbol ids cache
ids = ','.join(map(str, t2ids.values()))
yield get_quote
return get_quote
# Questrade key conversion / column order

View File

@ -72,11 +72,10 @@ async def get_client() -> Client:
yield Client()
@asynccontextmanager
async def quoter(client: Client, tickers: [str]):
"""Quoter context.
"""
yield client.quote
return client.quote
# Robinhood key conversion / column order