summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xglucometer.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/glucometer.py b/glucometer.py
index c037d7c..5440f0d 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