From f53205cdf147185e7001aaf9b0d724abc14dad7f Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 11 Oct 2016 21:12:40 +0300 Subject: revert most of the recent Pylint fixes I know better how to name my things. --- vk/tracking/online_sessions.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'vk/tracking/online_sessions.py') 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()) -- cgit v1.2.3