diff options
author | Diego Elio Pettenò <flameeyes@flameeyes.eu> | 2017-04-15 16:46:07 +0200 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@flameeyes.eu> | 2017-04-15 16:46:07 +0200 |
commit | 5cd9d030828af745e833a9280031d298617a5a71 (patch) | |
tree | aed9c5d13df2b5f99ff60c7d8323cc4609448390 | |
parent | glucometer: log a better error if the driver name is not found. (diff) | |
download | glucometerutils-5cd9d030828af745e833a9280031d298617a5a71.tar glucometerutils-5cd9d030828af745e833a9280031d298617a5a71.tar.gz glucometerutils-5cd9d030828af745e833a9280031d298617a5a71.tar.bz2 glucometerutils-5cd9d030828af745e833a9280031d298617a5a71.tar.lz glucometerutils-5cd9d030828af745e833a9280031d298617a5a71.tar.xz glucometerutils-5cd9d030828af745e833a9280031d298617a5a71.tar.zst glucometerutils-5cd9d030828af745e833a9280031d298617a5a71.zip |
-rwxr-xr-x | glucometer.py | 6 |
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': |