Skip to content

Commit

Permalink
app: fix pylint 'possible variable use before assignment' error
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
bkueng committed May 29, 2024
1 parent 2dad6c1 commit ff171ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions app/tornado_handlers/three_d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit ff171ae

Please sign in to comment.