summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDorian Scholz <DorianScholz@gmx.de>2017-05-30 07:35:18 +0200
committerDorian Scholz <DorianScholz@gmx.de>2017-05-30 07:35:18 +0200
commite259d1228638f9749d2bc87c0585d0e7a864a36d (patch)
treeef84fa5cba59be4b6daf63e522bc0242a60db245
parentAdd the Optium Neo as an untested supported device. (diff)
downloadglucometerutils-e259d1228638f9749d2bc87c0585d0e7a864a36d.tar
glucometerutils-e259d1228638f9749d2bc87c0585d0e7a864a36d.tar.gz
glucometerutils-e259d1228638f9749d2bc87c0585d0e7a864a36d.tar.bz2
glucometerutils-e259d1228638f9749d2bc87c0585d0e7a864a36d.tar.lz
glucometerutils-e259d1228638f9749d2bc87c0585d0e7a864a36d.tar.xz
glucometerutils-e259d1228638f9749d2bc87c0585d0e7a864a36d.tar.zst
glucometerutils-e259d1228638f9749d2bc87c0585d0e7a864a36d.zip
-rwxr-xr-xglucometer.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/glucometer.py b/glucometer.py
index 19a47a8..9b3e66e 100755
--- a/glucometer.py
+++ b/glucometer.py
@@ -13,8 +13,6 @@ import inspect
import logging
import sys
-from dateutil import parser as date_parser
-
from glucometerutils import common
from glucometerutils import exceptions
@@ -108,7 +106,11 @@ def main():
print(device.set_datetime())
elif args.set:
try:
+ from dateutil import parser as date_parser
new_date = date_parser.parse(args.set)
+ except ImportError:
+ logging.error('could not import module "dateutil", please install it.')
+ return 1
except ValueError:
logging.error('%s: not a valid date', args.set)
return 1