From 4f6ca71886615758f9473e259c192ee4359fb388 Mon Sep 17 00:00:00 2001 From: Simon Posch Date: Fri, 31 Jan 2020 20:42:26 +0100 Subject: [PATCH] STCC-200 replace python with python2, add python to default.ini PATHS (#133) --- config/default.ini | 2 +- run | 2 +- run_dbg | 2 +- run_tests | 2 +- src/scratchtocatrobat/test_main.py | 2 +- src/scratchtocatrobat/tools/helpers.py | 2 +- web/main.py | 2 +- web/worker/converterjob.py | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/default.ini b/config/default.ini index 715bdc11..7e2fa3e6 100755 --- a/config/default.ini +++ b/config/default.ini @@ -35,7 +35,7 @@ code_file_name: project.json ;------------------------------------------------------------------------------- [PATHS] - +python: python2 jython_home: /usr/jython jython_exec: %(jython_home)s/bin/jython batik_home: ${LIB_PATH}/batik-1.7 diff --git a/run b/run index a41426b5..97f76134 100755 --- a/run +++ b/run @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # ScratchToCatrobat: A tool for converting Scratch projects into Catrobat programs. diff --git a/run_dbg b/run_dbg index 2afe40ab..1a8febd7 100755 --- a/run_dbg +++ b/run_dbg @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # ScratchToCatrobat: A tool for converting Scratch projects into Catrobat programs. diff --git a/run_tests b/run_tests index 5346d068..dc5c6f14 100755 --- a/run_tests +++ b/run_tests @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # ScratchToCatrobat: A tool for converting Scratch projects into Catrobat programs. diff --git a/src/scratchtocatrobat/test_main.py b/src/scratchtocatrobat/test_main.py index 1ef48d2d..015dfd29 100644 --- a/src/scratchtocatrobat/test_main.py +++ b/src/scratchtocatrobat/test_main.py @@ -37,7 +37,7 @@ class MainTest(common_testing.ProjectTestCase): def __init__(self, *args): super(MainTest, self).__init__(*args) self._main_method = main.run_converter - self.base_exec_args = ["python", os.path.join(common.get_project_base_path(), "run")] + self.base_exec_args = [helpers.config.get("PATHS", "python"), os.path.join(common.get_project_base_path(), "run")] def execute_run_script(self, args, env=None): if not env: diff --git a/src/scratchtocatrobat/tools/helpers.py b/src/scratchtocatrobat/tools/helpers.py index 33bb79a6..2d2160ba 100644 --- a/src/scratchtocatrobat/tools/helpers.py +++ b/src/scratchtocatrobat/tools/helpers.py @@ -293,7 +293,7 @@ def formatted_shell_script_code(content): gitCount=`/usr/bin/env git rev-list $branchName |wc -l | sed 's/^ *//;s/ *$//'` buildNumber="$((gitCount + 1))" - /usr/bin/env python - <) diff --git a/web/worker/converterjob.py b/web/worker/converterjob.py index c811aedf..a3dedac9 100644 --- a/web/worker/converterjob.py +++ b/web/worker/converterjob.py @@ -77,7 +77,7 @@ def run_job(self, args): assert isinstance(args["outputDir"], (str, unicode)) job_ID, title, image_URL = args["jobID"], args["title"], args["imageURL"] - exec_args = ["/usr/bin/env", "python", CONVERTER_RUN_SCRIPT_PATH, + exec_args = [helpers.config.get("PATHS", "python"), CONVERTER_RUN_SCRIPT_PATH, args["url"], args["outputDir"], str(args["jobID"]), "--web-mode"] process = subprocess.Popen(exec_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) yield self.send_job_started_notification(job_ID, title, image_URL)