Move config module to top level

fsp_feeds
Tyler Goodlet 2021-09-06 21:26:28 -04:00
parent 73b555a677
commit 15025d6047
5 changed files with 12 additions and 11 deletions

View File

@ -53,7 +53,7 @@ from ib_insync.client import Client as ib_Client
from fuzzywuzzy import process as fuzzy
import numpy as np
from . import config
from .. import config
from ..log import get_logger, get_console_log
from .._daemon import maybe_spawn_brokerd
from ..data._source import from_df

View File

@ -43,7 +43,7 @@ import asks
from ..calc import humanize, percent_change
from .._cacheables import open_cached_client, async_lifo_cache
from . import config
from .. import config
from ._util import resproc, BrokerError, SymbolNotFound
from ..log import get_logger, colorize_json, get_console_log
from . import get_brokermod

View File

@ -8,8 +8,9 @@ import trio
import tractor
from ..log import get_console_log, get_logger, colorize_json
from ..brokers import get_brokermod, config
from ..brokers import get_brokermod
from .._daemon import _tractor_kwargs
from .. import config
log = get_logger('cli')

View File

@ -25,7 +25,7 @@ from typing import Optional
import toml
import click
from ..log import get_logger
from .log import get_logger
log = get_logger('broker-config')

View File

@ -47,7 +47,7 @@ from PyQt5.QtWidgets import (
from ._event import open_handlers
from ._style import hcolor, _font, _font_small, DpiAwareFont
from ._label import FormatLabel
from .. import brokers
from .. import config
class FontAndChartAwareLineEdit(QLineEdit):
@ -382,21 +382,21 @@ def mk_form(
form._font_size = font_size or _font_small.px_size
# generate sub-components from schema dict
for key, config in fields_schema.items():
wtype = config['type']
label = str(config.get('label', key))
for key, conf in fields_schema.items():
wtype = conf['type']
label = str(conf.get('label', key))
# plain (line) edit field
if wtype == 'edit':
w = form.add_edit_field(
key,
label,
config['default_value']
conf['default_value']
)
# drop-down selection
elif wtype == 'select':
values = list(config['default_value'])
values = list(conf['default_value'])
w = form.add_select_field(
key,
label,
@ -635,7 +635,7 @@ def mk_order_pane_layout(
# font_size: int = _font_small.px_size - 2
font_size: int = _font.px_size - 2
accounts = brokers.config.load_accounts()
accounts = config.load_accounts()
# TODO: maybe just allocate the whole fields form here
# and expect an async ctx entry?