summaryrefslogtreecommitdiffstats
path: root/glucometerutils
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@flameeyes.eu>2016-03-02 00:08:33 +0100
committerDiego Elio Pettenò <flameeyes@flameeyes.eu>2016-03-02 00:08:33 +0100
commit195793d442ea29dcea0227d53c24c51d811c58ad (patch)
tree495aaaf98ca1711ac8c404b87822545039c40ad3 /glucometerutils
parentMove the InvalidChecksum exception to the base exceptions module. (diff)
downloadglucometerutils-195793d442ea29dcea0227d53c24c51d811c58ad.tar
glucometerutils-195793d442ea29dcea0227d53c24c51d811c58ad.tar.gz
glucometerutils-195793d442ea29dcea0227d53c24c51d811c58ad.tar.bz2
glucometerutils-195793d442ea29dcea0227d53c24c51d811c58ad.tar.lz
glucometerutils-195793d442ea29dcea0227d53c24c51d811c58ad.tar.xz
glucometerutils-195793d442ea29dcea0227d53c24c51d811c58ad.tar.zst
glucometerutils-195793d442ea29dcea0227d53c24c51d811c58ad.zip
Diffstat (limited to 'glucometerutils')
-rw-r--r--glucometerutils/drivers/freestyle_optium.py4
-rw-r--r--glucometerutils/drivers/otultra2.py4
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)