From cb6e304043332bab5d9a4768eb697979cd5d96c4 Mon Sep 17 00:00:00 2001 From: Ansem Date: Fri, 7 Apr 2017 22:06:06 +0000 Subject: Fix write access_token to file mistake --- mastodon/Mastodon.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index d2d759a..36965ac 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py @@ -191,12 +191,7 @@ class Mastodon: are wrong, scopes are not valid or granted scopes differ from requested. Returns: - { - 'scope': 'read', - 'created_at': 1491599341, - 'access_token': 'd8daf46d...', - 'token_type': 'bearer' - } + str @access_token """ if username is not None and password is not None: params = self.__generate_params(locals(), ['scopes', 'to_file', 'code', 'refresh_token']) @@ -231,7 +226,7 @@ class Mastodon: if to_file != None: with open(to_file, 'w') as token_file: - token_file.write(response + '\n') + token_file.write(response['access_token'] + '\n') return response['access_token'] -- cgit v1.2.3