aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/vk/tracking/db/timestamp.py
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-10-11 21:12:40 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-10-11 21:12:40 +0300
commitf53205cdf147185e7001aaf9b0d724abc14dad7f (patch)
treea924f1492c42fe9e2362e2b52cfdea03a7f5539d /vk/tracking/db/timestamp.py
parentREADME update (diff)
downloadvk-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 '')
-rw-r--r--vk/tracking/db/timestamp.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/vk/tracking/db/timestamp.py b/vk/tracking/db/timestamp.py
index 0881fb3..b2219ca 100644
--- a/vk/tracking/db/timestamp.py
+++ b/vk/tracking/db/timestamp.py
@@ -11,25 +11,25 @@ class Timestamp:
return datetime.utcnow()
@staticmethod
- def _is_timezone_aware(impl):
- return impl.tzinfo is not None and impl.tzinfo.utcoffset(impl) is not None
+ def _is_timezone_aware(dt):
+ return dt.tzinfo is not None and dt.tzinfo.utcoffset(dt) is not None
@staticmethod
- def _lose_timezone(impl):
- if Timestamp._is_timezone_aware(impl):
- return impl.astimezone(timezone.utc).replace(tzinfo=None)
- return impl
+ def _lose_timezone(dt):
+ if Timestamp._is_timezone_aware(dt):
+ return dt.astimezone(timezone.utc).replace(tzinfo=None)
+ return dt
- def __init__(self, impl=None):
- if impl is None:
- impl = self._new()
- impl = impl.replace(microsecond=0)
- impl = self._lose_timezone(impl)
- self.impl = impl
+ def __init__(self, dt=None):
+ if dt is None:
+ dt = self._new()
+ dt = dt.replace(microsecond=0)
+ dt = self._lose_timezone(dt)
+ self.dt = dt
@staticmethod
- def from_string(src):
- return Timestamp(datetime.strptime(src, '%Y-%m-%dT%H:%M:%SZ'))
+ def from_string(s):
+ return Timestamp(datetime.strptime(s, '%Y-%m-%dT%H:%M:%SZ'))
def __str__(self):
- return self.impl.isoformat() + 'Z'
+ return self.dt.isoformat() + 'Z'