Beispiel #1
0
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]
Beispiel #2
0
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')
Beispiel #3
0
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
Beispiel #4
0
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')
Beispiel #5
0
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
Beispiel #6
0
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')
Beispiel #7
0
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')
Beispiel #8
0
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
Beispiel #9
0
def pass_ctx_from_parent(ctx):
    pass_ctx_from_root(ctx)
    ctx.logger = ctx.parent.logger
Beispiel #10
0
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)
Beispiel #11
0
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
Beispiel #12
0
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)
Beispiel #13
0
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)