From 1e0da90e7b0806f7ec175c6d60b78938dd7a1634 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Sun, 15 Jan 2017 13:24:46 +0000 Subject: Move the readings-to-csv conversion to the Reading class. --- glucometer.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'glucometer.py') diff --git a/glucometer.py b/glucometer.py index 8e19237..148daff 100755 --- a/glucometer.py +++ b/glucometer.py @@ -76,9 +76,7 @@ def main(): readings, key=lambda reading: getattr(reading, args.sort_by)) for reading in readings: - print('"%s","%.2f","%s","%s"' % ( - reading.timestamp, reading.get_value_as(unit), - reading.meal, reading.comment)) + print(reading.as_csv(unit)) elif args.action == 'datetime': if args.set == 'now': print(device.set_datetime()) -- cgit v1.2.3