diff --git a/toot/config.py b/toot/config.py index 9fffb01..8fbe447 100644 --- a/toot/config.py +++ b/toot/config.py @@ -7,10 +7,6 @@ CONFIG_APP_FILE = CONFIG_DIR + 'app.cfg' CONFIG_USER_FILE = CONFIG_DIR + 'user.cfg' -def collapse(tuple): - return [v for k, v in tuple.__dict__.items()] - - def _load(file, tuple_class): if not os.path.exists(file): return None @@ -29,7 +25,7 @@ def _save(file, named_tuple): os.makedirs(directory) with open(file, 'w') as f: - values = [v for k, v in named_tuple.__dict__.items()] + values = [v for v in named_tuple] return f.write("\n".join(values)) diff --git a/toot/console.py b/toot/console.py index 5ab97e5..6281a33 100644 --- a/toot/console.py +++ b/toot/console.py @@ -29,6 +29,8 @@ def create_app_interactive(): print("App tokens saved to: {}".format(green(CONFIG_APP_FILE))) save_app(app) + return app + def login_interactive(app): print("\nLog in to " + green(app.base_url)) @@ -55,12 +57,12 @@ def print_usage(): def cmd_post_status(app, user): if len(sys.argv) < 3: - print red("No status text given") + print(red("No status text given")) return response = post_status(app, user, sys.argv[2]) - print "Toot posted: " + green(response.get('url')) + print("Toot posted: " + green(response.get('url'))) def cmd_auth(app, user):