def cli(ctx, config_filename, verbose): if verbose: logging.basicConfig(level=logging.DEBUG) else: logging.basicConfig(level=logging.INFO) ctx.obj = {} # Load the config, saving the result in the context. If there's an error, # chances are it'll panic here. try: Config.load_file(config_filename) except Exception as e: click.secho(str(e), fg='red') sys.exit(1) # Create the global Github API client and store it in the context client = Github(Config.access_token) ctx.obj['client'] = client Processor.configure_client(client) Processor.configure_detectors(Config.detectors) Processor.configure_notifiers(Config.notifiers) State.load_file()