mirror of
https://github.com/ihabunek/toot
synced 2024-12-23 07:27:12 +01:00
parent
f7f867f1b3
commit
b06e9ea733
@ -219,6 +219,6 @@ def get_notifications(app, user):
|
|||||||
return http.get(app, user, '/api/v1/notifications').json()
|
return http.get(app, user, '/api/v1/notifications').json()
|
||||||
|
|
||||||
|
|
||||||
def get_instance(domain):
|
def get_instance(domain, scheme="https"):
|
||||||
url = "http://{}/api/v1/instance".format(domain)
|
url = "{}://{}/api/v1/instance".format(scheme, domain)
|
||||||
return http.anon_get(url).json()
|
return http.anon_get(url).json()
|
||||||
|
@ -12,7 +12,7 @@ from toot.output import print_out
|
|||||||
|
|
||||||
def register_app(domain, scheme='https'):
|
def register_app(domain, scheme='https'):
|
||||||
print_out("Looking up instance info...")
|
print_out("Looking up instance info...")
|
||||||
instance = api.get_instance(domain)
|
instance = api.get_instance(domain, scheme)
|
||||||
|
|
||||||
print_out("Found instance <blue>{}</blue> running Mastodon version <yellow>{}</yellow>".format(
|
print_out("Found instance <blue>{}</blue> running Mastodon version <yellow>{}</yellow>".format(
|
||||||
instance['title'], instance['version']))
|
instance['title'], instance['version']))
|
||||||
|
@ -219,7 +219,7 @@ def instance(app, user, args):
|
|||||||
assert_domain_exists(name)
|
assert_domain_exists(name)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
instance = api.get_instance(name)
|
instance = api.get_instance(name, args.scheme)
|
||||||
print_instance(instance)
|
print_instance(instance)
|
||||||
except NotFoundError:
|
except NotFoundError:
|
||||||
raise ConsoleError(
|
raise ConsoleError(
|
||||||
|
@ -131,7 +131,7 @@ READ_COMMANDS = [
|
|||||||
"help": "instance domain (e.g. 'mastodon.social') or blank to use current",
|
"help": "instance domain (e.g. 'mastodon.social') or blank to use current",
|
||||||
"nargs": "?",
|
"nargs": "?",
|
||||||
}),
|
}),
|
||||||
|
scheme_arg,
|
||||||
],
|
],
|
||||||
require_auth=False,
|
require_auth=False,
|
||||||
),
|
),
|
||||||
|
Loading…
Reference in New Issue
Block a user