def account(ctx, source): pass_ctx_from_root(ctx) ctx.source = source ctx.location = pyyjj.location(pyyjj.mode.LIVE, pyyjj.category.SYSTEM, 'etc', 'kungfu', ctx.locator) ctx.db = AccountsDB(ctx.location, 'accounts') ctx.schema = ACCOUNT_SCHEMA[source]
def extension(ctx): pass_ctx_from_root(ctx) if not os.getenv('KF_NO_EXT'): pass else: print('Extension disabled by KF_NO_EXT') ctx.logger.warning( 'Trying to manage extension while disallowed by KF_NO_EXT')
def pass_ctx_from_parent(ctx): pass_ctx_from_root(ctx) ctx.logger = ctx.parent.logger ctx.mode = ctx.parent.mode ctx.category = ctx.parent.category ctx.group = ctx.parent.group ctx.name = ctx.parent.name ctx.location = ctx.parent.location ctx.journal_util_location = ctx.parent.journal_util_location
def extension(ctx): pass_ctx_from_root(ctx) ctx.journal_util_location = pyyjj.location(pyyjj.mode.LIVE, pyyjj.category.SYSTEM, 'util', 'extension', ctx.locator) ctx.logger = create_logger('extension', ctx.log_level, ctx.journal_util_location) if not os.getenv('KF_NO_EXT'): pass else: print('Extension disabled by KF_NO_EXT') ctx.logger.warning('Trying to manage extension while disallowed by KF_NO_EXT')
def pass_ctx_from_parent(ctx): pass_ctx_from_root(ctx) ctx.logger = ctx.parent.logger ctx.low_latency = ctx.parent.low_latency ctx.mode = ctx.parent.mode ctx.category = ctx.parent.category ctx.group = ctx.parent.group ctx.name = ctx.parent.name ctx.locator = ctx.parent.locator ctx.location = ctx.parent.location
def journal(ctx, mode, category, group, name): pass_ctx_from_root(ctx) ctx.low_latency = False ctx.mode = mode ctx.category = category ctx.group = group ctx.name = name ctx.location = pyyjj.location(kfj.MODES[mode], kfj.CATEGORIES[category], group, name, ctx.locator) ctx.journal_util_location = pyyjj.location(pyyjj.mode.LIVE, pyyjj.category.SYSTEM, 'util', 'journal', ctx.locator) ctx.logger = create_logger('journal', ctx.log_level, ctx.journal_util_location) pyyjj.setup_log(ctx.journal_util_location, 'journal')
def backtest(ctx, group, name): print('entering history') pass_ctx_from_root(ctx) ctx.category = 'md' ctx.group = group ctx.name = name ctx.mode = 'backtest' #ctx.location = pyyjj.location(kfj.MODES[ctx.mode], kfj.CATEGORIES[ctx.category], group, name, ctx.locator) ctx.journal_util_location = pyyjj.location(pyyjj.mode.LIVE, pyyjj.category.SYSTEM, 'util', 'journal', ctx.locator) ctx.logger = create_logger('journal', ctx.log_level, ctx.journal_util_location) pyyjj.setup_log(ctx.journal_util_location, 'journal')
def pass_ctx_from_parent(ctx): pass_ctx_from_root(ctx) ctx.source = ctx.parent.source ctx.location = ctx.parent.location ctx.db = ctx.parent.db ctx.schema = ctx.parent.schema
def pass_ctx_from_parent(ctx): pass_ctx_from_root(ctx) ctx.logger = ctx.parent.logger
def dev(ctx): pass_ctx_from_root(ctx) ctx.dev_location = pyyjj.location(pyyjj.mode.LIVE, pyyjj.category.SYSTEM, 'dev', 'dev', ctx.locator) ctx.io_device = pyyjj.io_device(ctx.dev_location)
def pass_ctx_from_parent(ctx): pass_ctx_from_root(ctx) ctx.dev_location = ctx.parent.dev_location ctx.io_device = ctx.parent.io_device
def test(ctx): pass_ctx_from_root(ctx) ctx.test_location = pyyjj.location(pyyjj.mode.LIVE, pyyjj.category.SYSTEM, 'test', 'test', ctx.locator) ctx.io_device = pyyjj.io_device(ctx.test_location)
def package(ctx): pass_ctx_from_root(ctx) ctx.location = pyyjj.location(pyyjj.mode.LIVE, pyyjj.category.SYSTEM, 'util', 'package', ctx.locator) ctx.logger = create_logger('package', ctx.log_level, ctx.location)