pull/2/head
Ivan Habunek 2017-04-12 17:12:47 +02:00
rodzic cc512bf759
commit 26be88aed6
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: CDBD63C43A30BB95
2 zmienionych plików z 5 dodań i 7 usunięć

Wyświetl plik

@ -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))

Wyświetl plik

@ -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):