Fix code style
This commit is contained in:
parent
cf9efc128a
commit
177af4fac9
3 changed files with 14 additions and 11 deletions
|
@ -37,7 +37,7 @@ def _process_response(response):
|
|||
error = data['error_description']
|
||||
elif "error" in data:
|
||||
error = data['error']
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
if response.status_code == 404:
|
||||
|
|
|
@ -74,7 +74,7 @@ def post(app, user, args):
|
|||
else:
|
||||
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')))
|
||||
|
||||
|
@ -83,8 +83,10 @@ def auth(app, user, args):
|
|||
if app and user:
|
||||
print_out("You are logged in to <yellow>{}</yellow> as <yellow>{}</yellow>\n".format(
|
||||
app.instance, user.username))
|
||||
print_out("User data: <green>{}</green>".format(config.get_user_config_path()))
|
||||
print_out("App data: <green>{}</green>".format(config.get_instance_config_path(app.instance)))
|
||||
print_out("User data: <green>{}</green>".format(
|
||||
config.get_user_config_path()))
|
||||
print_out("App data: <green>{}</green>".format(
|
||||
config.get_instance_config_path(app.instance)))
|
||||
else:
|
||||
print_out("You are not logged in")
|
||||
|
||||
|
@ -114,9 +116,10 @@ def logout(app, user, args):
|
|||
def upload(app, user, args):
|
||||
response = _do_upload(app, user, args.file)
|
||||
|
||||
msg = "Successfully uploaded media ID <yellow>{}</yellow>, type '<yellow>{}</yellow>'"
|
||||
|
||||
print_out()
|
||||
print_out("Successfully uploaded media ID <yellow>{}</yellow>, type '<yellow>{}</yellow>'".format(
|
||||
response['id'], response['type']))
|
||||
print_out(msg.format(response['id'], response['type']))
|
||||
print_out("Original URL: <green>{}</green>".format(response['url']))
|
||||
print_out("Preview URL: <green>{}</green>".format(response['preview_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
|
||||
|
||||
START_CODES = {
|
||||
'red': '\033[31m',
|
||||
'green': '\033[32m',
|
||||
'yellow': '\033[33m',
|
||||
'blue': '\033[34m',
|
||||
'red': '\033[31m',
|
||||
'green': '\033[32m',
|
||||
'yellow': '\033[33m',
|
||||
'blue': '\033[34m',
|
||||
'magenta': '\033[35m',
|
||||
'cyan': '\033[36m',
|
||||
'cyan': '\033[36m',
|
||||
}
|
||||
|
||||
END_CODE = '\033[0m'
|
||||
|
|
Loading…
Reference in a new issue