Import client for now until we make a proper shim

kivy_mainline_and_py3.8
Tyler Goodlet 2018-02-12 10:35:54 -05:00
parent f4fd35fa21
commit 9f3efd2a6a
1 changed files with 9 additions and 6 deletions

View File

@ -6,13 +6,17 @@ import json
from os import path from os import path
import trio import trio
from async_generator import asynccontextmanager from async_generator import asynccontextmanager
from ..brokers import questrade
from ..calc import percent_change
@asynccontextmanager get_client = questrade.get_client
async def get_client() -> None:
"""Shim client factory. # @asynccontextmanager
""" # async def get_client() -> None:
yield None # """Shim client factory.
# """
# yield None
async def poll_tickers( async def poll_tickers(
@ -23,7 +27,6 @@ async def poll_tickers(
content = quotes_file.read() content = quotes_file.read()
pkts = content.split('--') # simulate 2 separate quote packets pkts = content.split('--') # simulate 2 separate quote packets
# import pdb; pdb.set_trace()
payloads = [json.loads(pkt)['quotes'] for pkt in pkts] payloads = [json.loads(pkt)['quotes'] for pkt in pkts]
for payload in cycle(payloads): for payload in cycle(payloads):