def cli(ctx, config, verbose): """Decentralised, minimalist microblogging service for hackers.""" init_logging(debug=verbose) if ctx.invoked_subcommand == "quickstart": return # Skip initializing config file try: if config: conf = Config.from_file(config) else: conf = Config.discover() except ValueError as e: if "Error in config file." in str(e): click.echo( "✗ Please correct the errors mentioned above an run twtxt again." ) else: click.echo( "✗ Config file not found or not readable. You may want to run twtxt quickstart." ) sys.exit() ctx.default_map = conf.build_default_map() ctx.obj = {'conf': conf}
def cli(ctx, config, verbose): """Decentralised, minimalist microblogging service for hackers.""" init_logging(debug=verbose) try: if config: conf = Config.from_file(config) else: conf = Config.discover() except ValueError: click.echo("Error loading config file.") if not config: if click.confirm("Do you want to run the twtxt quickstart wizard?", abort=True): pass ctx.default_map = conf.build_default_map() ctx.obj = {'conf': conf}
def cli(ctx, config, verbose): """Decentralised, minimalist microblogging service for hackers.""" init_logging(debug=verbose) if ctx.invoked_subcommand == "quickstart": return try: if config: conf = Config.from_file(config) else: conf = Config.discover() except ValueError: click.echo("✗ Config file not found or not readable. You may want to run twtxt quickstart.") sys.exit() ctx.default_map = conf.build_default_map() ctx.obj = {'conf': conf}
def cli(ctx, config, verbose): """Decentralised, minimalist microblogging service for hackers.""" init_logging(debug=verbose) if ctx.invoked_subcommand == "quickstart": return try: if config: conf = Config.from_file(config) else: conf = Config.discover() except ValueError: click.echo( "✗ Config file not found or not readable. You may want to run twtxt quickstart." ) sys.exit() ctx.default_map = conf.build_default_map() ctx.obj = {'conf': conf}
def cli(ctx, config, verbose): """Decentralised, minimalist microblogging service for hackers.""" init_logging(debug=verbose) if ctx.invoked_subcommand == "quickstart": return # Skip initializing config file try: if config: conf = Config.from_file(config) else: conf = Config.discover() except ValueError as e: if "Error in config file." in str(e): click.echo("✗ Please correct the errors mentioned above an run twtxt again.") else: click.echo("✗ Config file not found or not readable. You may want to run twtxt quickstart.") sys.exit() ctx.default_map = conf.build_default_map() ctx.obj = {'conf': conf}