summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@flameeyes.eu>2018-12-12 22:08:46 +0100
committerDiego Elio Pettenò <flameeyes@flameeyes.eu>2018-12-12 22:08:46 +0100
commit7e02c3498362b32e5cfd800b61dd96bba778d3a4 (patch)
tree1b46476f36536aaf70752a98d5455968dbb3c2da
parentExperimentally start adding type annotations, and mypy configs. (diff)
downloadglucometerutils-7e02c3498362b32e5cfd800b61dd96bba778d3a4.tar
glucometerutils-7e02c3498362b32e5cfd800b61dd96bba778d3a4.tar.gz
glucometerutils-7e02c3498362b32e5cfd800b61dd96bba778d3a4.tar.bz2
glucometerutils-7e02c3498362b32e5cfd800b61dd96bba778d3a4.tar.lz
glucometerutils-7e02c3498362b32e5cfd800b61dd96bba778d3a4.tar.xz
glucometerutils-7e02c3498362b32e5cfd800b61dd96bba778d3a4.tar.zst
glucometerutils-7e02c3498362b32e5cfd800b61dd96bba778d3a4.zip
-rwxr-xr-xglucometerutils/glucometer.py10
1 files changed, 1 insertions, 9 deletions
diff --git a/glucometerutils/glucometer.py b/glucometerutils/glucometer.py
index cd2331c..30efc83 100755
--- a/glucometerutils/glucometer.py
+++ b/glucometerutils/glucometer.py
@@ -52,10 +52,6 @@ def main():
choices=[unit.value for unit in common.Unit],
help='Select the unit to use for the dumped data.')
parser_dump.add_argument(
- '--sort-by', action='store', default='timestamp',
- choices=common._ReadingBase._fields,
- help='Field to order the dumped data by.')
- parser_dump.add_argument(
'--with-ketone', action='store_true', default=False,
help='Enable ketone reading if available on the glucometer.')
@@ -107,11 +103,7 @@ def main():
readings = (reading for reading in readings
if not isinstance(reading, common.KetoneReading))
- if args.sort_by is not None:
- readings = sorted(
- readings, key=lambda reading: getattr(reading, args.sort_by))
-
- for reading in readings:
+ for reading in sorted(readings, key=lambda r: r.timestamp):
print(reading.as_csv(unit))
elif args.action == 'datetime':
if args.set == 'now':