summaryrefslogtreecommitdiffstats
path: root/glucometer.py
diff options
context:
space:
mode:
Diffstat (limited to 'glucometer.py')
-rwxr-xr-xglucometer.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/glucometer.py b/glucometer.py
index 5d75bcb..dc5d78b 100755
--- a/glucometer.py
+++ b/glucometer.py
@@ -98,9 +98,11 @@ def main():
print(device.set_datetime())
elif args.set:
try:
- print(device.set_datetime(date_parser.parse(args.set)))
+ new_date = date_parser.parse(args.set)
except ValueError:
- print('%s: not a valid date' % args.set, file=sys.stderr)
+ logging.error('%s: not a valid date', args.set)
+ return 1
+ print(device.set_datetime(new_date))
else:
print(device.get_datetime())
elif args.action == 'zero':