Skip to content

Commit

Permalink
Python script shebang cleanup (#37859)
Browse files Browse the repository at this point in the history
* Use explicit Python version in json tools

These tools used '#!/usr/bin/env python' but required Python 2.  This no
longer works on systems where Python 3 is the default.

Tweak their #! lines to specify python2.

* Remove space from #! line

* Make gfx_tools find python by path

The scripts in tools/gfx_tools were running /bin/python directly.  The
convention is to use /usr/bin/env python, so switch to that.

Also, they were not executable.  Make them so.

* Make Python scripts executable

Some Python scripts had #! lines but were not executable.  Make them so.
  • Loading branch information
jbytheway authored Feb 9, 2020
1 parent 92a81b5 commit f2881ee
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 10 deletions.
Empty file modified tools/copy_from.py
100644 → 100755
Empty file.
Empty file modified tools/fix-compilation-database.py
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion tools/gfx_tools/compose.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/python
#!/usr/bin/env python

# compose.py
# Split a gfx directory made of 1000s of little images and files into a set of tilesheets
Expand Down
2 changes: 1 addition & 1 deletion tools/gfx_tools/decompose.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/python
#!/usr/bin/env python

# decompose.py
# Split a gfx tile_config.json into 1000s of little directories, each with their own config
Expand Down
3 changes: 1 addition & 2 deletions tools/gfx_tools/png_update.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/python
#!/usr/bin/env python

# png_update.py
# Rename a png and update all references to it.
Expand Down Expand Up @@ -154,4 +154,3 @@ def convert_tile_entry_file(file_path, old_name, new_name):
os.rename(old_path, new_path)



2 changes: 1 addition & 1 deletion tools/json_tools/keys.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2
"""Run this script with -h for usage info and docs.
"""

Expand Down
2 changes: 1 addition & 1 deletion tools/json_tools/lister.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2
"""Run this script with -h for usage info and docs.
"""

Expand Down
2 changes: 1 addition & 1 deletion tools/json_tools/pluck.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2
"""Run this script with -h for usage info and docs.
"""

Expand Down
2 changes: 1 addition & 1 deletion tools/json_tools/splitter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2
"""Run this script with -h for usage info and docs.
"""

Expand Down
2 changes: 1 addition & 1 deletion tools/json_tools/values.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2
"""Run this script with -h for usage info and docs.
"""

Expand Down
Empty file modified tools/update_blueprint_needs.py
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion utilities/building-utility/deconstruct.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/env python
#!/usr/bin/env python
'''Tool to combine ascii map cells with json templates.
Original design and implementation: acidia (https://github.com/acidia)
Expand Down

0 comments on commit f2881ee

Please sign in to comment.