From ff171ae3e2bd11d83f969b55801546b53edb754a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Wed, 29 May 2024 14:06:06 +0200 Subject: [PATCH] app: fix pylint 'possible variable use before assignment' error Fixes these (new) pylint errors: ~/work/flight_review/flight_review/app ~/work/flight_review/flight_review ************* Module three_d tornado_handlers/three_d.py:133:45: E0606: Possibly using variable 'start_timestamp' before assignment (possibly-used-before-assignment) ************* Module serve serve.py:149:39: E0606: Possibly using variable 'ulog_file' before assignment (possibly-used-before-assignment) --- app/serve.py | 1 + app/tornado_handlers/three_d.py | 1 + 2 files changed, 2 insertions(+) diff --git a/app/serve.py b/app/serve.py index 0abc47f42..efb4ceea7 100755 --- a/app/serve.py +++ b/app/serve.py @@ -100,6 +100,7 @@ def _fixup_deprecated_host_args(arguments): show_ulog_file = False show_3d_page = False show_pid_analysis_page = False +ulog_file = '' if args.file is not None: ulog_file = os.path.abspath(args.file) show_ulog_file = True diff --git a/app/tornado_handlers/three_d.py b/app/tornado_handlers/three_d.py index 5fe414464..b1f6f9fe8 100644 --- a/app/tornado_handlers/three_d.py +++ b/app/tornado_handlers/three_d.py @@ -119,6 +119,7 @@ def get(self, *args, **kwargs): # - altitude requires an offset (to match the GPS data) # - it's worse for some logs where the estimation is bad -> acro flights # (-> add both: user-selectable between GPS & estimated trajectory?) + start_timestamp = 0 for i in range(len(gps_pos.data['timestamp'])): t = gps_pos.data['timestamp'][i] + utc_offset utctimestamp = datetime.datetime.utcfromtimestamp(t/1.e6).replace(