Add toot env command

pull/268/head
Ivan Habunek 2022-12-11 23:46:54 +01:00
rodzic c74d2ad916
commit 29ff629464
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: CDBD63C43A30BB95
2 zmienionych plików z 14 dodań i 1 usunięć

Wyświetl plik

@ -1,9 +1,10 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import sys import sys
import platform
from datetime import datetime, timedelta, timezone from datetime import datetime, timedelta, timezone
from toot import api, config from toot import api, config, __version__
from toot.auth import login_interactive, login_browser_interactive, create_app_interactive from toot.auth import login_interactive, login_browser_interactive, create_app_interactive
from toot.exceptions import ApiError, ConsoleError from toot.exceptions import ApiError, ConsoleError
from toot.output import (print_out, print_instance, print_account, print_acct_list, from toot.output import (print_out, print_instance, print_account, print_acct_list,
@ -220,6 +221,12 @@ def auth(app, user, args):
print_out("\nAuth tokens are stored in: <blue>{}</blue>".format(path)) print_out("\nAuth tokens are stored in: <blue>{}</blue>".format(path))
def env(app, user, args):
print_out(f"toot {__version__}")
print_out(f"Python {sys.version}")
print_out(platform.platform())
def login_cli(app, user, args): def login_cli(app, user, args):
app = create_app_interactive(instance=args.instance, scheme=args.scheme) app = create_app_interactive(instance=args.instance, scheme=args.scheme)
login_interactive(app, args.email) login_interactive(app, args.email)

Wyświetl plik

@ -223,6 +223,12 @@ AUTH_COMMANDS = [
arguments=[], arguments=[],
require_auth=False, require_auth=False,
), ),
Command(
name="env",
description="Print environment information for inclusion in bug reports.",
arguments=[],
require_auth=False,
),
] ]
TUI_COMMANDS = [ TUI_COMMANDS = [