Exemplo n.º 1
0
def pytest_configure():
    # Be sure not to load local config during tests.
    os.environ['ADDOK_CONFIG_MODULE'] = ''
    from addok import config
    config.REDIS['db'] = 15
    import logging
    logging.basicConfig(level=logging.DEBUG)
    config.load(config, discover=False)
Exemplo n.º 2
0
def main():

    config_parser = argparse.ArgumentParser(add_help=False)
    config_parser.add_argument('--config', help='Local config')
    args, unknown = config_parser.parse_known_args()
    if args.config:
        os.environ['ADDOK_CONFIG_MODULE'] = args.config

    main_parser = argparse.ArgumentParser(description='Addok command line.')
    main_parser.add_argument('--config', help='Local config')
    subparsers = main_parser.add_subparsers(title='Available commands',
                                            metavar='')

    from addok import config
    config.load(config)
    config.pm.hook.addok_register_command(subparsers=subparsers)
    args = main_parser.parse_args()
    if getattr(args, 'func', None):
        args.func(args)
    else:
        main_parser.print_help()
Exemplo n.º 3
0
def main():

    config_parser = argparse.ArgumentParser(add_help=False)
    config_parser.add_argument('--config', help='Local config')
    args, unknown = config_parser.parse_known_args()
    if args.config:
        os.environ['ADDOK_CONFIG_MODULE'] = args.config

    main_parser = argparse.ArgumentParser(description='Addok command line.')
    main_parser.add_argument('--config', help='Local config')
    subparsers = main_parser.add_subparsers(title='Available commands',
                                            metavar='')

    from addok import config, hooks
    config.load(config)
    hooks.register_command(subparsers)
    args = main_parser.parse_args()
    if getattr(args, 'func', None):
        args.func(args)
    else:
        main_parser.print_help()
Exemplo n.º 4
0
def pytest_configure():
    from addok import config
    config.REDIS['db'] = 15
    import logging
    logging.basicConfig(level=logging.DEBUG)
    config.load(config, discover=False)
Exemplo n.º 5
0
def pytest_configure():
    from addok import config
    config.REDIS['db'] = 15
    import logging
    logging.basicConfig(level=logging.DEBUG)
    config.load(config, discover=False)