diff options
author | Ansem <[email protected]> | 2017-04-07 22:06:06 +0000 |
---|---|---|
committer | Ansem <[email protected]> | 2017-04-07 22:06:06 +0000 |
commit | cb6e304043332bab5d9a4768eb697979cd5d96c4 (patch) | |
tree | 9a2c9aef8519fa6378adb6ef3f8f3731b99496a3 | |
parent | ebfe65a2957b3fe28ddf0bb769a488325a44cde3 (diff) | |
download | mastodon.py-cb6e304043332bab5d9a4768eb697979cd5d96c4.tar.gz |
Fix write access_token to file mistake
-rw-r--r-- | mastodon/Mastodon.py | 9 |
1 files 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: | |||
191 | are wrong, scopes are not valid or granted scopes differ from requested. | 191 | are wrong, scopes are not valid or granted scopes differ from requested. |
192 | 192 | ||
193 | Returns: | 193 | Returns: |
194 | { | 194 | str @access_token |
195 | 'scope': 'read', | ||
196 | 'created_at': 1491599341, | ||
197 | 'access_token': 'd8daf46d...', | ||
198 | 'token_type': 'bearer' | ||
199 | } | ||
200 | """ | 195 | """ |
201 | if username is not None and password is not None: | 196 | if username is not None and password is not None: |
202 | params = self.__generate_params(locals(), ['scopes', 'to_file', 'code', 'refresh_token']) | 197 | params = self.__generate_params(locals(), ['scopes', 'to_file', 'code', 'refresh_token']) |
@@ -231,7 +226,7 @@ class Mastodon: | |||
231 | 226 | ||
232 | if to_file != None: | 227 | if to_file != None: |
233 | with open(to_file, 'w') as token_file: | 228 | with open(to_file, 'w') as token_file: |
234 | token_file.write(response + '\n') | 229 | token_file.write(response['access_token'] + '\n') |
235 | 230 | ||
236 | return response['access_token'] | 231 | return response['access_token'] |
237 | 232 | ||