diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2019-12-23 07:20:36 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2019-12-23 07:20:36 +0300 |
commit | 7b8cc8a9f455eda41b9c7d70f4561a84fcda941e (patch) | |
tree | b9e262e9a1dbb663c3b9f704a9fe4daf54be0ce9 /vk/last_seen.py | |
parent | Travis: online_sessions.sh: refactoring (diff) | |
download | vk-scripts-7b8cc8a9f455eda41b9c7d70f4561a84fcda941e.tar.gz vk-scripts-7b8cc8a9f455eda41b9c7d70f4561a84fcda941e.zip |
pylint/pep8 fixes
Diffstat (limited to 'vk/last_seen.py')
-rw-r--r-- | vk/last_seen.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/vk/last_seen.py b/vk/last_seen.py index 25975f2..cf76db5 100644 --- a/vk/last_seen.py +++ b/vk/last_seen.py @@ -11,6 +11,7 @@ from numbers import Integral, Real from .platform import Platform + def _parse_time(x): if isinstance(x, datetime): if x.tzinfo is None or x.tzinfo.utcoffset(x) is None: @@ -20,6 +21,7 @@ def _parse_time(x): return datetime.fromtimestamp(x, tz=timezone.utc) raise TypeError() + def _parse_platform(x): if x in Platform: return x @@ -27,6 +29,7 @@ def _parse_platform(x): return Platform.from_string(x) return Platform(x) + class LastSeenField(Enum): TIME = 'time' PLATFORM = 'platform' @@ -34,6 +37,7 @@ class LastSeenField(Enum): def __str__(self): return self.value + class LastSeen(MutableMapping): @staticmethod def from_api_response(source): |