aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2018-06-05 17:57:22 +0200
committerLorenz Diener <[email protected]>2018-06-05 17:57:22 +0200
commitb08c05e6de786b5fc0dc3189e73b6192e6e198b6 (patch)
treee306364556fae4eaf6a55c31ff679b8f6ec97055
parent256037f272c5312dc9c0478498d6abd55fa9fd19 (diff)
downloadmastodon.py-b08c05e6de786b5fc0dc3189e73b6192e6e198b6.tar.gz
Fix specifying only access token
-rw-r--r--mastodon/Mastodon.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py
index 67401dd..52b55df 100644
--- a/mastodon/Mastodon.py
+++ b/mastodon/Mastodon.py
@@ -189,7 +189,8 @@ class Mastodon:
189 version_check_mode = "created"): 189 version_check_mode = "created"):
190 """ 190 """
191 Create a new API wrapper instance based on the given `client_secret` and `client_id`. If you 191 Create a new API wrapper instance based on the given `client_secret` and `client_id`. If you
192 give a `client_id` and it is not a file, you must also give a secret. 192 give a `client_id` and it is not a file, you must also give a secret. If you specify an
193 `access_token` then you don't need to specify a `client_id`.
193 194
194 You can also specify an `access_token`, directly or as a file (as written by `log_in()`_). 195 You can also specify an `access_token`, directly or as a file (as written by `log_in()`_).
195 196
@@ -267,9 +268,9 @@ class Mastodon:
267 if self.client_secret is None: 268 if self.client_secret is None:
268 raise MastodonIllegalArgumentError('Specified client id directly, but did not supply secret') 269 raise MastodonIllegalArgumentError('Specified client id directly, but did not supply secret')
269 270
270 if self.access_token is not None and os.path.isfile(self.access_token): 271 if self.access_token is not None and os.path.isfile(self.access_token):
271 with open(self.access_token, 'r') as token_file: 272 with open(self.access_token, 'r') as token_file:
272 self.access_token = token_file.readline().rstrip() 273 self.access_token = token_file.readline().rstrip()
273 274
274 def retrieve_mastodon_version(self): 275 def retrieve_mastodon_version(self):
275 """ 276 """
Powered by cgit v1.2.3 (git 2.41.0)