Make toot instance work with localhost
Asserting the domain exists does not bring much value.
This commit is contained in:
parent
d308475afe
commit
ebc17e0764
1 changed files with 2 additions and 4 deletions
|
@ -4,7 +4,7 @@ import sys
|
||||||
|
|
||||||
from toot import api, config
|
from toot import api, config
|
||||||
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 ConsoleError, NotFoundError
|
from toot.exceptions import ApiError, ConsoleError, NotFoundError
|
||||||
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,
|
||||||
print_search_results, print_timeline, print_notifications)
|
print_search_results, print_timeline, print_notifications)
|
||||||
from toot.utils import assert_domain_exists, editor_input, multiline_input, EOF_KEY
|
from toot.utils import assert_domain_exists, editor_input, multiline_input, EOF_KEY
|
||||||
|
@ -331,12 +331,10 @@ def instance(app, user, args):
|
||||||
if not name:
|
if not name:
|
||||||
raise ConsoleError("Please specify instance name.")
|
raise ConsoleError("Please specify instance name.")
|
||||||
|
|
||||||
assert_domain_exists(name)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
instance = api.get_instance(name, args.scheme)
|
instance = api.get_instance(name, args.scheme)
|
||||||
print_instance(instance)
|
print_instance(instance)
|
||||||
except NotFoundError:
|
except ApiError:
|
||||||
raise ConsoleError(
|
raise ConsoleError(
|
||||||
"Instance not found at {}.\n"
|
"Instance not found at {}.\n"
|
||||||
"The given domain probably does not host a Mastodon instance.".format(name)
|
"The given domain probably does not host a Mastodon instance.".format(name)
|
||||||
|
|
Loading…
Reference in a new issue