From c0f0114dfc294b6bfbc027d69d1a3977650878a8 Mon Sep 17 00:00:00 2001 From: John Bytheway Date: Sun, 9 Feb 2020 06:57:18 -0500 Subject: [PATCH 1/5] 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. --- tools/json_tools/keys.py | 2 +- tools/json_tools/lister.py | 2 +- tools/json_tools/pluck.py | 2 +- tools/json_tools/splitter.py | 2 +- tools/json_tools/values.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/json_tools/keys.py b/tools/json_tools/keys.py index 8a7ee579caae0..245f196ca68b3 100755 --- a/tools/json_tools/keys.py +++ b/tools/json_tools/keys.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 """Run this script with -h for usage info and docs. """ diff --git a/tools/json_tools/lister.py b/tools/json_tools/lister.py index 7f4c2a79b7d80..487d35da41b62 100755 --- a/tools/json_tools/lister.py +++ b/tools/json_tools/lister.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 """Run this script with -h for usage info and docs. """ diff --git a/tools/json_tools/pluck.py b/tools/json_tools/pluck.py index 2617d97b97c1d..78633b602dfc2 100755 --- a/tools/json_tools/pluck.py +++ b/tools/json_tools/pluck.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 """Run this script with -h for usage info and docs. """ diff --git a/tools/json_tools/splitter.py b/tools/json_tools/splitter.py index 116a50e63c30f..25a944e86e60f 100755 --- a/tools/json_tools/splitter.py +++ b/tools/json_tools/splitter.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 """Run this script with -h for usage info and docs. """ diff --git a/tools/json_tools/values.py b/tools/json_tools/values.py index 8a87643822f7e..2ccfe99b91fc1 100755 --- a/tools/json_tools/values.py +++ b/tools/json_tools/values.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 """Run this script with -h for usage info and docs. """ From e6e1a1946bc93e2ae773003a27c630ac0414b600 Mon Sep 17 00:00:00 2001 From: John Bytheway Date: Sun, 9 Feb 2020 07:13:56 -0500 Subject: [PATCH 2/5] Remove space from #! line --- utilities/building-utility/deconstruct.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/building-utility/deconstruct.py b/utilities/building-utility/deconstruct.py index 215142fefae92..874f1dabdd6ad 100755 --- a/utilities/building-utility/deconstruct.py +++ b/utilities/building-utility/deconstruct.py @@ -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) From 78001ab825999c6f9a67e98130e99ee59a463cc2 Mon Sep 17 00:00:00 2001 From: John Bytheway Date: Sun, 9 Feb 2020 07:14:18 -0500 Subject: [PATCH 3/5] 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. --- tools/gfx_tools/compose.py | 2 +- tools/gfx_tools/decompose.py | 2 +- tools/gfx_tools/png_update.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 tools/gfx_tools/compose.py mode change 100644 => 100755 tools/gfx_tools/decompose.py mode change 100644 => 100755 tools/gfx_tools/png_update.py diff --git a/tools/gfx_tools/compose.py b/tools/gfx_tools/compose.py old mode 100644 new mode 100755 index d8f8a0fcceeac..d0c8017ff48ea --- a/tools/gfx_tools/compose.py +++ b/tools/gfx_tools/compose.py @@ -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 diff --git a/tools/gfx_tools/decompose.py b/tools/gfx_tools/decompose.py old mode 100644 new mode 100755 index 0e8ef64b42b4e..50a2d50fbdd25 --- a/tools/gfx_tools/decompose.py +++ b/tools/gfx_tools/decompose.py @@ -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 diff --git a/tools/gfx_tools/png_update.py b/tools/gfx_tools/png_update.py old mode 100644 new mode 100755 index 82b58db5e6124..745bf282dae1f --- a/tools/gfx_tools/png_update.py +++ b/tools/gfx_tools/png_update.py @@ -1,4 +1,4 @@ -#!/bin/python +#!/usr/bin/end python # png_update.py # Rename a png and update all references to it. From 71b60f73e9a78187f120fcc9df3899e28808c8fc Mon Sep 17 00:00:00 2001 From: John Bytheway Date: Sun, 9 Feb 2020 08:49:17 -0500 Subject: [PATCH 4/5] Make Python scripts executable Some Python scripts had #! lines but were not executable. Make them so. --- tools/copy_from.py | 0 tools/fix-compilation-database.py | 0 tools/update_blueprint_needs.py | 0 3 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tools/copy_from.py mode change 100644 => 100755 tools/fix-compilation-database.py mode change 100644 => 100755 tools/update_blueprint_needs.py diff --git a/tools/copy_from.py b/tools/copy_from.py old mode 100644 new mode 100755 diff --git a/tools/fix-compilation-database.py b/tools/fix-compilation-database.py old mode 100644 new mode 100755 diff --git a/tools/update_blueprint_needs.py b/tools/update_blueprint_needs.py old mode 100644 new mode 100755 From 98e74e2a2e6125c42a161548fd171b3d5bae9c58 Mon Sep 17 00:00:00 2001 From: John Bytheway Date: Sun, 9 Feb 2020 14:05:34 +0000 Subject: [PATCH 5/5] Typo Co-Authored-By: anothersimulacrum --- tools/gfx_tools/png_update.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/gfx_tools/png_update.py b/tools/gfx_tools/png_update.py index 745bf282dae1f..885c60fc54494 100755 --- a/tools/gfx_tools/png_update.py +++ b/tools/gfx_tools/png_update.py @@ -1,4 +1,4 @@ -#!/usr/bin/end python +#!/usr/bin/env python # png_update.py # Rename a png and update all references to it. @@ -154,4 +154,3 @@ def convert_tile_entry_file(file_path, old_name, new_name): os.rename(old_path, new_path) -