Fix code style - toot - Unnamed repository; edit this file 'description' to nam… | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 177af4fac959be2a22940d141feab4f8848379c5 | |
parent cf9efc128a6507f9ba1276a4603b97ccf2999fc4 | |
Author: Ivan Habunek <[email protected]> | |
Date: Sat, 30 Dec 2017 13:14:37 +0100 | |
Fix code style | |
Diffstat: | |
toot/api.py | 2 +- | |
toot/commands.py | 13 ++++++++----- | |
toot/output.py | 10 +++++----- | |
3 files changed, 14 insertions(+), 11 deletions(-) | |
--- | |
diff --git a/toot/api.py b/toot/api.py | |
@@ -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: | |
diff --git a/toot/commands.py b/toot/commands.py | |
@@ -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, visi… | |
+ response = api.post_status(app, user, args.text, args.visibility, media_id… | |
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>{}</yel… | |
app.instance, user.username)) | |
- print_out("User data: <green>{}</green>".format(config.get_user_config… | |
- print_out("App data: <green>{}</green>".format(config.get_instance_co… | |
+ 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>{… | |
+ | |
print_out() | |
- print_out("Successfully uploaded media ID <yellow>{}</yellow>, type '<yell… | |
- 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'])) | |
diff --git a/toot/output.py b/toot/output.py | |
@@ -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' |