aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/vk/last_seen.py
diff options
context:
space:
mode:
Diffstat (limited to 'vk/last_seen.py')
-rw-r--r--vk/last_seen.py4
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):