diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2016-06-10 16:26:09 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2016-06-10 16:26:09 +0300 |
commit | f6167c2e17452690aa8c6dfe5b4c67fbfb74e33a (patch) | |
tree | 2fd8d9e05d6941a35a40816b297eb2ed8e0960be /track_status.py | |
parent | refactoring (diff) | |
download | vk-scripts-f6167c2e17452690aa8c6dfe5b4c67fbfb74e33a.tar.gz vk-scripts-f6167c2e17452690aa8c6dfe5b4c67fbfb74e33a.zip |
api.ConnectionError -> api.APIConnectionError
To avoid clashes with the standard library.
Diffstat (limited to '')
-rw-r--r-- | track_status.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/track_status.py b/track_status.py index 3953428..78c0dce 100644 --- a/track_status.py +++ b/track_status.py @@ -4,7 +4,7 @@ import logging, time -import api +from api import * def format_user(user): if user.has_last_name(): @@ -52,7 +52,7 @@ def print_status_update(user): else: user_went_offline(user) -USER_FIELDS = api.User.Field.ONLINE, api.User.Field.LAST_SEEN +USER_FIELDS = User.Field.ONLINE, User.Field.LAST_SEEN def update_status(api, uids): return {user.get_uid(): user for user in api.users_get(uids, USER_FIELDS)} @@ -67,7 +67,7 @@ def loop_update_status(api, uids, timeout=DEFAULT_TIMEOUT): time.sleep(timeout) try: updated_users = update_status(api, uids) - except api.ConnectionError: + except APIConnectionError: continue for uid in updated_users: if users[uid].is_online() != updated_users[uid].is_online(): @@ -101,7 +101,7 @@ if __name__ == '__main__': level=logging.INFO, datefmt='%Y-%m-%d %H:%M:%S') - api = api.API(api.Language.EN) + api = API(Language.EN) try: loop_update_status(api, args.uids, timeout=args.timeout) |