From 195793d442ea29dcea0227d53c24c51d811c58ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Tue, 1 Mar 2016 23:08:33 +0000 Subject: Use a more Pythonic map(..., int) instead of list comprehension. --- glucometerutils/drivers/freestyle_optium.py | 4 ++-- glucometerutils/drivers/otultra2.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/glucometerutils/drivers/freestyle_optium.py b/glucometerutils/drivers/freestyle_optium.py index cbf171e..659c9c3 100644 --- a/glucometerutils/drivers/freestyle_optium.py +++ b/glucometerutils/drivers/freestyle_optium.py @@ -74,7 +74,7 @@ def _parse_clock(datestr): month = _MONTH_MATCHES[match.group('month')] year = int(match.group('year')) - hour, minute, second = (int(part) for part in match.group('time').split(':')) + hour, minute, second = map(match.group('time').split(':'), int) return datetime.datetime(year, month, day, hour, minute, second) @@ -264,7 +264,7 @@ class Device(object): month = _MONTH_MATCHES[match.group('month')] year = int(match.group('year')) - hour, minute = (int(part) for part in match.group('time').split(':')) + hour, minute = map(match.group('time').split(':'), int) timestamp = datetime.datetime(year, month, day, hour, minute) diff --git a/glucometerutils/drivers/otultra2.py b/glucometerutils/drivers/otultra2.py index 522d9a0..9bb52d1 100644 --- a/glucometerutils/drivers/otultra2.py +++ b/glucometerutils/drivers/otultra2.py @@ -115,8 +115,8 @@ def _parse_datetime(response): raise exceptions.InvalidResponse(response) date, time = match.groups() - month, day, year = [int(part) for part in date.split('/')] - hour, minute, second = [int(part) for part in time.split(':')] + month, day, year = map(date.split('/'), int) + hour, minute, second = map(time.split(':'), int) # Yes, OneTouch2's firmware is not Y2K safe. return datetime.datetime(2000 + year, month, day, hour, minute, second) -- cgit v1.2.3