예제 #1
0
파일: commands.py 프로젝트: sudoWright/toot
def upload(app, user, args):
    response = _do_upload(app, user, args.file)

    print("\nSuccessfully uploaded media ID {}, type '{}'".format(
        yellow(response['id']), yellow(response['type'])))
    print("Original URL: " + green(response['url']))
    print("Preview URL:  " + green(response['preview_url']))
    print("Text URL:     " + green(response['text_url']))
예제 #2
0
파일: commands.py 프로젝트: sudoWright/toot
def auth(app, user, args):
    if app and user:
        print("You are logged in to {} as {}\n".format(yellow(app.instance),
                                                       yellow(user.username)))
        print("User data: " + green(config.get_user_config_path()))
        print("App data:  " +
              green(config.get_instance_config_path(app.instance)))
    else:
        print("You are not logged in")
예제 #3
0
파일: commands.py 프로젝트: sudoWright/toot
def login_2fa(app, user, args):
    print()
    print(yellow("Two factor authentication is experimental."))
    print(yellow("If you have problems logging in, please open an issue:"))
    print(yellow("https://github.com/ihabunek/toot/issues"))
    print()

    app = create_app_interactive()
    two_factor_login_interactive(app)

    print()
    print(green("✓ Successfully logged in."))
예제 #4
0
파일: commands.py 프로젝트: sudoWright/toot
def _print_account(account):
    print("{} {}".format(green("@" + account['acct']),
                         account['display_name']))

    if account['note']:
        print("")
        note = BeautifulSoup(account['note'], "html.parser")
        print("\n".join(wrap(note.get_text())))

    print("")
    print("ID: " + green(account['id']))
    print("Since: " + green(account['created_at'][:19].replace('T', ' @ ')))
    print("")
    print("Followers: " + yellow(account['followers_count']))
    print("Following: " + yellow(account['following_count']))
    print("Statuses: " + yellow(account['statuses_count']))
    print("")
    print(account['url'])