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 from fuzzywuzzy import process as fuzzy
import numpy as np import numpy as np
from . import config from .. import config
from ..log import get_logger, get_console_log from ..log import get_logger, get_console_log
from .._daemon import maybe_spawn_brokerd from .._daemon import maybe_spawn_brokerd
from ..data._source import from_df from ..data._source import from_df

View File

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

View File

@ -8,8 +8,9 @@ import trio
import tractor import tractor
from ..log import get_console_log, get_logger, colorize_json 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 .._daemon import _tractor_kwargs
from .. import config
log = get_logger('cli') log = get_logger('cli')

View File

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

View File

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