From 87d8fb75811a4186b27baf24d12a155a7acce414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Tue, 1 Mar 2016 23:01:33 +0000 Subject: Move the InvalidChecksum exception to the base exceptions module. Most glucometers have *some* sort of checksum, so there is no reason to implement this on a per-driver basis. --- glucometerutils/drivers/freestyle_optium.py | 9 +-------- glucometerutils/drivers/lifescan_common.py | 7 ------- glucometerutils/drivers/otultra2.py | 6 +++--- glucometerutils/drivers/otultraeasy.py | 2 +- glucometerutils/drivers/otverio2015.py | 3 +-- glucometerutils/exceptions.py | 7 +++++++ test/test_otultra2.py | 2 +- test/test_otultraeasy.py | 2 +- 8 files changed, 15 insertions(+), 23 deletions(-) diff --git a/glucometerutils/drivers/freestyle_optium.py b/glucometerutils/drivers/freestyle_optium.py index 7f4e020..cbf171e 100644 --- a/glucometerutils/drivers/freestyle_optium.py +++ b/glucometerutils/drivers/freestyle_optium.py @@ -21,13 +21,6 @@ from glucometerutils import common from glucometerutils import exceptions -class InvalidChecksum(exceptions.InvalidResponse): - def __init__(self, expected, gotten): - self.message = ( - 'Response checksum not matching: %04x expected, %04x gotten' % - (expected, gotten)) - - _CLOCK_RE = re.compile( r'^Clock:\t(?P[A-Z][a-z]{2}) (?P[0-9]{2}) (?P[0-9]{4})\t' r'(?P