diff options
author | Lorenz Diener <[email protected]> | 2022-11-21 20:17:18 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2022-11-21 20:17:18 +0200 |
commit | 943782afc394f52377223fb6b777946d5b2148ff (patch) | |
tree | 7fd8ad2031c281ac2a7cbc297fb20edd2fa4152e /mastodon/streaming.py | |
parent | 98760f650bcaafedead3f0b6e2b0c594ab857338 (diff) | |
parent | f04d57acbc5ef639c0dc70fde800cf5c24d0b967 (diff) | |
download | mastodon.py-943782afc394f52377223fb6b777946d5b2148ff.tar.gz |
Merge pull request #269 from eumiro/none_identity
Refactor: use is for None/True/False
Diffstat (limited to 'mastodon/streaming.py')
-rw-r--r-- | mastodon/streaming.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/mastodon/streaming.py b/mastodon/streaming.py index e43d7d6..08f5670 100644 --- a/mastodon/streaming.py +++ b/mastodon/streaming.py | |||
@@ -213,11 +213,11 @@ class CallbackStreamListener(StreamListener): | |||
213 | self.status_update_handler = status_update_handler | 213 | self.status_update_handler = status_update_handler |
214 | 214 | ||
215 | def on_update(self, status): | 215 | def on_update(self, status): |
216 | if self.update_handler != None: | 216 | if self.update_handler is not None: |
217 | self.update_handler(status) | 217 | self.update_handler(status) |
218 | 218 | ||
219 | try: | 219 | try: |
220 | if self.local_update_handler != None and not "@" in status["account"]["acct"]: | 220 | if self.local_update_handler is not None and not "@" in status["account"]["acct"]: |
221 | self.local_update_handler(status) | 221 | self.local_update_handler(status) |
222 | except Exception as err: | 222 | except Exception as err: |
223 | six.raise_from( | 223 | six.raise_from( |
@@ -226,21 +226,21 @@ class CallbackStreamListener(StreamListener): | |||
226 | ) | 226 | ) |
227 | 227 | ||
228 | def on_delete(self, deleted_id): | 228 | def on_delete(self, deleted_id): |
229 | if self.delete_handler != None: | 229 | if self.delete_handler is not None: |
230 | self.delete_handler(deleted_id) | 230 | self.delete_handler(deleted_id) |
231 | 231 | ||
232 | def on_notification(self, notification): | 232 | def on_notification(self, notification): |
233 | if self.notification_handler != None: | 233 | if self.notification_handler is not None: |
234 | self.notification_handler(notification) | 234 | self.notification_handler(notification) |
235 | 235 | ||
236 | def on_conversation(self, conversation): | 236 | def on_conversation(self, conversation): |
237 | if self.conversation_handler != None: | 237 | if self.conversation_handler is not None: |
238 | self.conversation_handler(conversation) | 238 | self.conversation_handler(conversation) |
239 | 239 | ||
240 | def on_unknown_event(self, name, unknown_event=None): | 240 | def on_unknown_event(self, name, unknown_event=None): |
241 | if self.unknown_event_handler != None: | 241 | if self.unknown_event_handler is not None: |
242 | self.unknown_event_handler(name, unknown_event) | 242 | self.unknown_event_handler(name, unknown_event) |
243 | 243 | ||
244 | def on_status_update(self, status): | 244 | def on_status_update(self, status): |
245 | if self.status_update_handler != None: | 245 | if self.status_update_handler is not None: |
246 | self.status_update_handler(status) | 246 | self.status_update_handler(status) |