aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2017-04-26 12:19:41 +0200
committerLorenz Diener <[email protected]>2017-04-26 12:19:41 +0200
commit7cfb17d6981c0814c3b5c38f3bc9712a73d1da03 (patch)
tree7531a5757dc02bdafab36b0f1c66ffe98e8e85e0 /mastodon
parent4a2f6d0fb90958aab54dab86666ed6034d0e1929 (diff)
downloadmastodon.py-7cfb17d6981c0814c3b5c38f3bc9712a73d1da03.tar.gz
Documentation and consistence changes
Diffstat (limited to 'mastodon')
-rw-r--r--mastodon/Mastodon.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py
index e670a7f..88daac8 100644
--- a/mastodon/Mastodon.py
+++ b/mastodon/Mastodon.py
@@ -133,19 +133,23 @@ class Mastodon:
133 133
134 134
135 def __get_token_expired(self): 135 def __get_token_expired(self):
136 """Internal helper for oauth code"""
136 if self._token_expired < datetime.datetime.now(): 137 if self._token_expired < datetime.datetime.now():
137 return True 138 return True
138 else: 139 else:
139 return False 140 return False
140 141
141 def __set_token_expired(self, value): 142 def __set_token_expired(self, value):
143 """Internal helper for oauth code"""
142 self._token_expired = datetime.datetime.now() + datetime.timedelta(seconds=value) 144 self._token_expired = datetime.datetime.now() + datetime.timedelta(seconds=value)
143 return 145 return
144 146
145 def __get_refresh_token(self): 147 def __get_refresh_token(self):
148 """Internal helper for oauth code"""
146 return self._refresh_token 149 return self._refresh_token
147 150
148 def __set_refresh_token(self, value): 151 def __set_refresh_token(self, value):
152 """Internal helper for oauth code"""
149 self._refresh_token = value 153 self._refresh_token = value
150 return 154 return
151 155
@@ -414,7 +418,7 @@ class Mastodon:
414 ### 418 ###
415 # Reading data: Searching 419 # Reading data: Searching
416 ### 420 ###
417 def content_search(self, q, resolve = False): 421 def search(self, q, resolve = False):
418 """ 422 """
419 Fetch matching hashtags, accounts and statuses. Will search federated 423 Fetch matching hashtags, accounts and statuses. Will search federated
420 instances if resolve is True. 424 instances if resolve is True.
@@ -676,6 +680,9 @@ class Mastodon:
676 media_file_description = (file_name, media_file, mime_type) 680 media_file_description = (file_name, media_file, mime_type)
677 return self.__api_request('POST', '/api/v1/media', files = {'file': media_file_description}) 681 return self.__api_request('POST', '/api/v1/media', files = {'file': media_file_description})
678 682
683 ###
684 # Streaming
685 ###
679 def user_stream(self, listener): 686 def user_stream(self, listener):
680 """ 687 """
681 Streams events that are relevant to the authorized user, i.e. home 688 Streams events that are relevant to the authorized user, i.e. home
Powered by cgit v1.2.3 (git 2.41.0)