summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@flameeyes.eu>2017-01-17 02:01:08 +0100
committerDiego Elio Pettenò <flameeyes@flameeyes.eu>2017-01-17 02:01:08 +0100
commit14c657fd69c689299a01b2dacdfbf7a1e3a3957b (patch)
tree885ebff080fdf1a12ea7674d5268d449bbf90de8
parentfsinsulinx: add untested FreeStyle InsuLinx driver. (diff)
downloadglucometerutils-14c657fd69c689299a01b2dacdfbf7a1e3a3957b.tar
glucometerutils-14c657fd69c689299a01b2dacdfbf7a1e3a3957b.tar.gz
glucometerutils-14c657fd69c689299a01b2dacdfbf7a1e3a3957b.tar.bz2
glucometerutils-14c657fd69c689299a01b2dacdfbf7a1e3a3957b.tar.lz
glucometerutils-14c657fd69c689299a01b2dacdfbf7a1e3a3957b.tar.xz
glucometerutils-14c657fd69c689299a01b2dacdfbf7a1e3a3957b.tar.zst
glucometerutils-14c657fd69c689299a01b2dacdfbf7a1e3a3957b.zip
-rw-r--r--glucometerutils/support/freestyle.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/glucometerutils/support/freestyle.py b/glucometerutils/support/freestyle.py
index 9857086..307cf64 100644
--- a/glucometerutils/support/freestyle.py
+++ b/glucometerutils/support/freestyle.py
@@ -12,6 +12,7 @@ __license__ = 'MIT'
import csv
import datetime
+import os.path
import re
import struct
@@ -68,6 +69,9 @@ class FreeStyleHidDevice(object):
TEXT_REPLY_CMD = 0x60
def __init__(self, device):
+ if not os.path.exists(device):
+ raise exceptions.ConnectionFailed(
+ message='Path %s does not exist.' % device)
self.handle_ = open(device, 'w+b')
def connect(self):