aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/vk/tracking/status_tracker.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--vk/tracking/status_tracker.py34
1 files changed, 17 insertions, 17 deletions
diff --git a/vk/tracking/status_tracker.py b/vk/tracking/status_tracker.py
index d52af6a..d47de39 100644
--- a/vk/tracking/status_tracker.py
+++ b/vk/tracking/status_tracker.py
@@ -27,21 +27,21 @@ class StatusTracker:
self.add_status_update_handler(writer.on_status_update)
self.add_connection_error_handler(writer.on_connection_error)
- def add_initial_status_handler(self, handler):
- self._assert_is_callback(handler)
- self._on_initial_status.append(handler)
+ def add_initial_status_handler(self, fn):
+ self._assert_is_callback(fn)
+ self._on_initial_status.append(fn)
- def add_status_update_handler(self, handler):
- self._assert_is_callback(handler)
- self._on_status_update.append(handler)
+ def add_status_update_handler(self, fn):
+ self._assert_is_callback(fn)
+ self._on_status_update.append(fn)
- def add_connection_error_handler(self, handler):
- self._assert_is_callback(handler)
- self._on_connection_error.append(handler)
+ def add_connection_error_handler(self, fn):
+ self._assert_is_callback(fn)
+ self._on_connection_error.append(fn)
@staticmethod
- def _assert_is_callback(handler):
- if not isinstance(handler, Callable):
+ def _assert_is_callback(fn):
+ if not isinstance(fn, Callable):
raise TypeError()
_USER_FIELDS = UserField.DOMAIN, UserField.ONLINE, UserField.LAST_SEEN,
@@ -50,16 +50,16 @@ class StatusTracker:
return {user.get_uid(): user for user in self._api.users_get(uids, self._USER_FIELDS)}
def _notify_status(self, user):
- for handler in self._on_initial_status:
- handler(user)
+ for fn in self._on_initial_status:
+ fn(user)
def _notify_status_update(self, user):
- for handler in self._on_status_update:
- handler(user)
+ for fn in self._on_status_update:
+ fn(user)
def _notify_connection_error(self, e):
- for handler in self._on_connection_error:
- handler(e)
+ for fn in self._on_connection_error:
+ fn(e)
def _query_initial_status(self, uids):
while True: