aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/vk/tracking/online_sessions.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/online_sessions.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 'vk/tracking/online_sessions.py')
-rw-r--r--vk/tracking/online_sessions.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/vk/tracking/online_sessions.py b/vk/tracking/online_sessions.py
index 11d3196..204e1cc 100644
--- a/vk/tracking/online_sessions.py
+++ b/vk/tracking/online_sessions.py
@@ -99,20 +99,20 @@ class OnlineSessionEnumerator(MutableMapping):
return by_hour
@staticmethod
- def _split_into_days(time_from, time_to):
- while time_from.date() != time_to.date():
- next_day = time_from.date() + timedelta(days=1)
- yield time_from.date(), next_day - time_from
- time_from = next_day
- yield time_to.date(), time_to - time_from
+ def _split_into_days(a, b):
+ while a.date() != b.date():
+ next_day = a.date() + timedelta(days=1)
+ yield a.date(), next_day - a
+ a = next_day
+ yield b.date(), b - a
@staticmethod
- def _split_into_hours(time_from, time_to):
- while time_from.date() != time_to.date() or time_from.hour != time_to.hour:
- next_hour = time_from.replace(minute=0, second=0) + timedelta(hours=1)
- yield time_from.hour, next_hour - time_from
- time_from = next_hour
- yield time_to.hour, time_to - time_from
+ def _split_into_hours(a, b):
+ while a.date() != b.date() or a.hour != b.hour:
+ next_hour = a.replace(minute=0, second=0) + timedelta(hours=1)
+ yield a.hour, next_hour - a
+ a = next_hour
+ yield b.hour, b - a
def _process_database_record(self, record):
return self._close_user_session(record.to_user())