twtxt/cli.py
def follow(ctx, nick, url, force):
    """Add a new source to your followings."""
    source = Source(nick, url)
    sources = ctx.obj['conf'].following

    if not force:
        if source.nick in (source.nick for source in sources):
            click.confirm("➤ You’re already following {0}. Overwrite?".format(
                click.style(source.nick, bold=True)), default=False, abort=True)

        _, status = get_remote_status([source])[0]
        if not status or status.status_code != 200:
            click.confirm("➤ The feed of {0} at {1} is not available. Follow anyway?".format(
                click.style(source.nick, bold=True),
                click.style(source.url, bold=True)), default=False, abort=True)

    ctx.obj['conf'].add_source(source)
    click.echo("✓ You’re now following {0}.".format(
        click.style(source.nick, bold=True)))
def follow(ctx, nick, url, force):
    """Add a new source to your followings."""
    source = Source(nick, url)
    sources = ctx.obj['conf'].following

    if not force:
        if source.nick in (source.nick for source in sources):
            click.confirm("➤ You’re already following {0}. Overwrite?".format(
                click.style(source.nick, bold=True)), default=False, abort=True)

        _, status = get_remote_status([source])[0]
        if not status or status.status_code != 200:
            click.confirm("➤ The feed of {0} at {1} is not available. Follow anyway?".format(
                click.style(source.nick, bold=True),
                click.style(source.url, bold=True)), default=False, abort=True)

    ctx.obj['conf'].add_source(source)
    click.echo("✓ You’re now following {0}.".format(
        click.style(source.nick, bold=True)))
def follow ( ctx , nick , url , force ) : source = Source ( nick , url ) sources = ctx . obj [ 'conf' ] . following if not force : if source . nick in ( source . nick for source in sources ) : click . confirm ( "➤ You’re already following {0}. Overwrite?".for m at( click . style ( source . nick , bold = True ) ) , default = False , abort = True ) _ , status = get_remote_status ( [ source ] ) [ 0 ] if not status or status . status_code != 200 : click . confirm ( "➤ The feed of {0} at {1} is not available. Follow anyway?".f o rmat( click . style ( source . nick , bold = True ) , click . style ( source . url , bold = True ) ) , default = False , abort = True ) ctx . obj [ 'conf' ] . add_source ( source ) click . echo ( "✓ You’re now following {0}.".for m at( click . style ( source . nick , bold = True ) ) )
Add a new source to your followings.
Add a new source to your followings .