def define_build_commands(): """ Generate stub commands for now to build all tools (as the build is the same). If we move e.g. r3 out of this cycle, we'll just extract r3 from here and implement differently. """ for project_class in services.list_all(): # print'srvice class', project_class build_group.add_command(make_build_command(project_class))
def deploy_group(ctx, **kwargs): """deploy docker-related tools.""" projects = collections.OrderedDict() for p_cls in services.list_all(): projects[p_cls.name] = functools.partial(p_cls.project_from_click_context, ctx, **kwargs) print 'projects ', projects ctx.obj['service_factories'] = projects pass
def make_click_group(): # print 'invoking make_cli_group' @click.option('--debug/--no-debug', default=False, help='Set to increase verbosity', show_default=True) @click.pass_context def _cli(ctx, debug, **kwargs): projects = collections.OrderedDict() for p_cls in all_services: projects[p_cls.name] = functools.partial(p_cls.project_from_click_context, ctx, **kwargs) ctx.obj['service_factories'] = projects ctx.obj['debug'] = debug all_services = services.list_all() decorated_cli = _cli for p_cls in all_services: for option in p_cls.make_click_options(): decorated_cli = option(decorated_cli) return click.group()(decorated_cli)