From 9b91ecd4081ee2c4929f67948e42cf5d459c5d03 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 26 May 2020 13:08:16 -0400 Subject: [PATCH] Pass confdir and watchlist path to cli --- piker/cli/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/piker/cli/__init__.py b/piker/cli/__init__.py index ba5be310..cc528f8a 100644 --- a/piker/cli/__init__.py +++ b/piker/cli/__init__.py @@ -13,8 +13,8 @@ from ..brokers.core import _data_mods log = get_logger('cli') DEFAULT_BROKER = 'questrade' -# _config_dir = click.get_app_dir('piker') -# _watchlists_data_path = os.path.join(_config_dir, 'watchlists.json') +_config_dir = click.get_app_dir('piker') +_watchlists_data_path = os.path.join(_config_dir, 'watchlists.json') _context_defaults = dict( default_map={ 'monitor': { @@ -53,16 +53,18 @@ def cli(ctx, broker, loglevel, configdir): assert os.path.isdir(configdir), f"`{configdir}` is not a valid path" config._override_config_dir(configdir) - # ensure that ctx.obj exists even though we aren't using it (yet) ctx.ensure_object(dict) ctx.obj.update({ 'broker': broker, 'brokermod': get_brokermod(broker), 'loglevel': loglevel, 'log': get_console_log(loglevel), + 'confdir': _config_dir, + 'wl_path': _watchlists_data_path, }) # load downstream cli modules from ..brokers import cli as _ from ..watchlists import cli as _ +from ..data import marketstore as _