From d3d6bf495f756cdce00d6040086e65d381599541 Mon Sep 17 00:00:00 2001 From: Joep de Jong Date: Wed, 17 Apr 2024 15:49:59 +0200 Subject: [PATCH 1/3] Add first line The first line is currently skipped --- tiotools/tiologparse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiotools/tiologparse.py b/tiotools/tiologparse.py index bd880e8..4b1594c 100755 --- a/tiotools/tiologparse.py +++ b/tiotools/tiologparse.py @@ -243,7 +243,7 @@ def main(): time = float(linesegment.split('\t')[0]) except: break - while time <= firsttime: + while time < firsttime: linesegment = fd.readline() try: time = float(linesegment.split('\t')[0]) From 2d9a034ce561a0822e1f0db99c547d0cfb54552e Mon Sep 17 00:00:00 2001 From: Joep de Jong Date: Wed, 17 Apr 2024 16:10:43 +0200 Subject: [PATCH 2/3] Remove pop of datarates and finalrates `datarates` and `finalrates` are undefined for `route` when `route` has no `firsttime` --- tiotools/tiologparse.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tiotools/tiologparse.py b/tiotools/tiologparse.py index 4b1594c..bb198e1 100755 --- a/tiotools/tiologparse.py +++ b/tiotools/tiologparse.py @@ -165,8 +165,6 @@ def main(): tempfiles.pop(route) tempfilenames.pop(route) sensors.pop(route) - datarates.pop(route) - finaltimes.pop(route) routes.remove(route) From c9cdb2f07a304355e265a47e6be66d6f609047b0 Mon Sep 17 00:00:00 2001 From: Joep de Jong Date: Wed, 17 Apr 2024 16:14:22 +0200 Subject: [PATCH 3/3] Fix exit on separate --- tiotools/tiologparse.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tiotools/tiologparse.py b/tiotools/tiologparse.py index bb198e1..8480d2b 100755 --- a/tiotools/tiologparse.py +++ b/tiotools/tiologparse.py @@ -155,8 +155,7 @@ def main(): [print(f"- {route}") for route in routes] if args.separate: - exit - stop + exit(0) # Remove routes that don't have valid start times for idx,route in enumerate(list(routes)): # copy the routes