diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2016-10-11 21:12:40 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2016-10-11 21:12:40 +0300 |
commit | f53205cdf147185e7001aaf9b0d724abc14dad7f (patch) | |
tree | a924f1492c42fe9e2362e2b52cfdea03a7f5539d /vk/last_seen.py | |
parent | README update (diff) | |
download | vk-scripts-f53205cdf147185e7001aaf9b0d724abc14dad7f.tar.gz vk-scripts-f53205cdf147185e7001aaf9b0d724abc14dad7f.zip |
revert most of the recent Pylint fixes
I know better how to name my things.
Diffstat (limited to 'vk/last_seen.py')
-rw-r--r-- | vk/last_seen.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/vk/last_seen.py b/vk/last_seen.py index 1753e12..5266940 100644 --- a/vk/last_seen.py +++ b/vk/last_seen.py @@ -11,23 +11,23 @@ from numbers import Integral, Real from .platform import Platform -def _parse_time(src): - if isinstance(src, datetime): - if src.tzinfo is None or src.tzinfo.utcoffset(src) is None: - src = src.replace(tzinfo=timezone.utc) - return src - elif isinstance(src, Real) or isinstance(src, Integral): - return datetime.fromtimestamp(src, tz=timezone.utc) +def _parse_time(x): + if isinstance(x, datetime): + if x.tzinfo is None or x.tzinfo.utcoffset(x) is None: + x = x.replace(tzinfo=timezone.utc) + return x + elif isinstance(x, Real) or isinstance(x, Integral): + return datetime.fromtimestamp(x, tz=timezone.utc) else: raise TypeError() -def _parse_platform(src): - if src in Platform: - return src - if isinstance(src, str): - return Platform.from_string(src) +def _parse_platform(x): + if x in Platform: + return x + if isinstance(x, str): + return Platform.from_string(x) else: - return Platform(src) + return Platform(x) class LastSeenField(Enum): TIME = 'time' @@ -85,8 +85,8 @@ class LastSeen(MutableMapping): def get_time(self): return self[LastSeenField.TIME] - def set_time(self, timestamp): - self[LastSeenField.TIME] = timestamp + def set_time(self, time): + self[LastSeenField.TIME] = time def has_platform(self): return LastSeenField.PLATFORM in self |