mirror of
https://github.com/ihabunek/toot
synced 2025-02-04 13:17:33 +01:00
Fix code style
This commit is contained in:
parent
cf9efc128a
commit
177af4fac9
@ -37,7 +37,7 @@ def _process_response(response):
|
|||||||
error = data['error_description']
|
error = data['error_description']
|
||||||
elif "error" in data:
|
elif "error" in data:
|
||||||
error = data['error']
|
error = data['error']
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if response.status_code == 404:
|
if response.status_code == 404:
|
||||||
|
@ -74,7 +74,7 @@ def post(app, user, args):
|
|||||||
else:
|
else:
|
||||||
media_ids = None
|
media_ids = None
|
||||||
|
|
||||||
response = api.post_status(app, user, args.text, media_ids=media_ids, visibility=args.visibility)
|
response = api.post_status(app, user, args.text, args.visibility, media_ids)
|
||||||
|
|
||||||
print_out("Toot posted: <green>{}</green>".format(response.get('url')))
|
print_out("Toot posted: <green>{}</green>".format(response.get('url')))
|
||||||
|
|
||||||
@ -83,8 +83,10 @@ def auth(app, user, args):
|
|||||||
if app and user:
|
if app and user:
|
||||||
print_out("You are logged in to <yellow>{}</yellow> as <yellow>{}</yellow>\n".format(
|
print_out("You are logged in to <yellow>{}</yellow> as <yellow>{}</yellow>\n".format(
|
||||||
app.instance, user.username))
|
app.instance, user.username))
|
||||||
print_out("User data: <green>{}</green>".format(config.get_user_config_path()))
|
print_out("User data: <green>{}</green>".format(
|
||||||
print_out("App data: <green>{}</green>".format(config.get_instance_config_path(app.instance)))
|
config.get_user_config_path()))
|
||||||
|
print_out("App data: <green>{}</green>".format(
|
||||||
|
config.get_instance_config_path(app.instance)))
|
||||||
else:
|
else:
|
||||||
print_out("You are not logged in")
|
print_out("You are not logged in")
|
||||||
|
|
||||||
@ -114,9 +116,10 @@ def logout(app, user, args):
|
|||||||
def upload(app, user, args):
|
def upload(app, user, args):
|
||||||
response = _do_upload(app, user, args.file)
|
response = _do_upload(app, user, args.file)
|
||||||
|
|
||||||
|
msg = "Successfully uploaded media ID <yellow>{}</yellow>, type '<yellow>{}</yellow>'"
|
||||||
|
|
||||||
print_out()
|
print_out()
|
||||||
print_out("Successfully uploaded media ID <yellow>{}</yellow>, type '<yellow>{}</yellow>'".format(
|
print_out(msg.format(response['id'], response['type']))
|
||||||
response['id'], response['type']))
|
|
||||||
print_out("Original URL: <green>{}</green>".format(response['url']))
|
print_out("Original URL: <green>{}</green>".format(response['url']))
|
||||||
print_out("Preview URL: <green>{}</green>".format(response['preview_url']))
|
print_out("Preview URL: <green>{}</green>".format(response['preview_url']))
|
||||||
print_out("Text URL: <green>{}</green>".format(response['text_url']))
|
print_out("Text URL: <green>{}</green>".format(response['text_url']))
|
||||||
|
@ -7,12 +7,12 @@ from textwrap import wrap
|
|||||||
from toot.utils import format_content, get_text
|
from toot.utils import format_content, get_text
|
||||||
|
|
||||||
START_CODES = {
|
START_CODES = {
|
||||||
'red': '\033[31m',
|
'red': '\033[31m',
|
||||||
'green': '\033[32m',
|
'green': '\033[32m',
|
||||||
'yellow': '\033[33m',
|
'yellow': '\033[33m',
|
||||||
'blue': '\033[34m',
|
'blue': '\033[34m',
|
||||||
'magenta': '\033[35m',
|
'magenta': '\033[35m',
|
||||||
'cyan': '\033[36m',
|
'cyan': '\033[36m',
|
||||||
}
|
}
|
||||||
|
|
||||||
END_CODE = '\033[0m'
|
END_CODE = '\033[0m'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user