Skip to content

Update tools shebangs to python3 #24739

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Tools/boot_now.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
############################################################################
#
# Copyright (C) 2012-2015 PX4 Development Team. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Tools/compress.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import argparse
import lzma
Expand Down
6 changes: 3 additions & 3 deletions Tools/fetch_file.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
############################################################################
#
# Copyright (C) 2013-2014 PX4 Development Team. All rights reserved.
Expand Down Expand Up @@ -34,7 +34,7 @@

"""Fetch files via nsh console

Usage: python fetch_file.py [-l] [-f] [-d device] [-s speed] [-o out_path] path
Usage: python3 fetch_file.py [-l] [-f] [-d device] [-s speed] [-o out_path] path
\t-l\tList files
\t-f\tOverwrite existing files
\t-d\tSerial device
Expand Down Expand Up @@ -134,7 +134,7 @@ def _get_files_in_dir(ser, path, path_out, force, timeout):
_get_file(ser, path_fn, path_fn_out, force, timeout)

def _usage():
print("""Usage: python fetch_file.py [-l] [-f] [-d device] [-s speed] [-o out_path] path
print("""Usage: python3 fetch_file.py [-l] [-f] [-d device] [-s speed] [-o out_path] path
\t-l\tList files
\t-f\tOverwrite existing files
\t-d\tSerial device
Expand Down
10 changes: 5 additions & 5 deletions Tools/geotag_images_ulog.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#######################################################################################
#
# DeltaTag: enhanced geo-referencing survey images
Expand All @@ -15,8 +15,8 @@
# Note: DeltaTag does not make copies, it writes the Exif information directly to the images
#
# Install: pip install pyulog piexif Pillow numpy
# Run: python geotag_images_ulog.py [logfile] [image dir] (optional offset)
# eg: python geotag_images_ulog.py mylog.ulg ./images
# Run: python3 geotag_images_ulog.py [logfile] [image dir] (optional offset)
# eg: python3 geotag_images_ulog.py mylog.ulg ./images
#
# Parameters
# logfile: a ulog formatted logfile containing camera_capture events (survey missions)
Expand All @@ -39,8 +39,8 @@


if(len(sys.argv)) < 3:
print("Usage: python geotag_images_ulog.py [logfile] [image dir]")
print("Example: python geotag_images_ulog.py mylog.ulg ./images")
print("Usage: python3 geotag_images_ulog.py [logfile] [image dir]")
print("Example: python3 geotag_images_ulog.py mylog.ulg ./images")
print(len(sys.argv))
sys.exit()

Expand Down
2 changes: 1 addition & 1 deletion Tools/package_firmware.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import glob
import zipfile
Expand Down
4 changes: 2 additions & 2 deletions Tools/parameter_update.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

############################################################################
Expand Down Expand Up @@ -55,7 +55,7 @@
The script needs a list of files as an input. To quickly find and feed all the file
that it needs to inspect, one can simply pipe the result of a ripgrep -l command as follows:

rg -l '\.[gs]et\(|px4::params::' -tcpp | python parameter_update.py
rg -l '\.[gs]et\(|px4::params::' -tcpp | python3 parameter_update.py
"""

import re
Expand Down
2 changes: 1 addition & 1 deletion Tools/process_sensor_caldata.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
5) Move to a warm dry, still air, constant pressure environment.
6) Apply power for 45 minutes, keeping the board still.
7) Remove power and extract the .ulog file
8) Open a terminal window in the Firmware/Tools directory and run the python calibration script script file: 'python process_sensor_caldata.py <full path name to .ulog file>
8) Open a terminal window in the Firmware/Tools directory and run the python calibration script script file: 'python3 process_sensor_caldata.py <full path name to .ulog file>
9) Power the board, connect QGC and load the parameter from the generated .params file onto the board using QGC. Due to the number of parameters, loading them may take some time.
10) TODO - we need a way for user to reliably tell when parameters have all been changed and saved.
11) After parameters have finished loading, set SDLOG_MODE and SDLOG_PROFILE to their respective values prior to step 4) and remove power.
Expand Down
2 changes: 1 addition & 1 deletion Tools/px4.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
############################################################################
#
# Copyright (c) 2017-2020 PX4 Development Team. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Tools/px_mkfw.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
############################################################################
#
# Copyright (C) 2012, 2013 PX4 Development Team. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Tools/px_process_airframes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
############################################################################
#
# Copyright (C) 2013-2017 PX4 Development Team. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Tools/px_process_events.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
############################################################################
#
# Copyright (C) 2020 PX4 Development Team. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Tools/px_process_module_doc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
############################################################################
#
# Copyright (C) 2017 PX4 Development Team. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Tools/px_romfs_pruner.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
############################################################################
#
# Copyright (C) 2014-2018 PX4 Development Team. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Tools/run-clang-tidy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
#===- run-clang-tidy.py - Parallel clang-tidy runner ---------*- python -*--===#
#
Expand Down
2 changes: 1 addition & 1 deletion Tools/uorb_graph/create.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/env python3
#!/usr/bin/env python3

from __future__ import print_function

Expand Down
2 changes: 1 addition & 1 deletion Tools/validate_yaml.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/env python3
#!/usr/bin/env python3
""" Script to validate YAML file(s) against a YAML schema file """

from __future__ import print_function
Expand Down
Loading