Fix code style - toot - Unnamed repository; edit this file 'description' to name the repository.
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit 177af4fac959be2a22940d141feab4f8848379c5
(DIR) parent cf9efc128a6507f9ba1276a4603b97ccf2999fc4
(HTM) Author: Ivan Habunek <ivan@habunek.com>
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(-)
---
(DIR) 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:
(DIR) 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, 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']))
(DIR) 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'