gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taler-merchant-demos] 02/14: fix #6510


From: gnunet
Subject: [taler-taler-merchant-demos] 02/14: fix #6510
Date: Sun, 06 Sep 2020 11:20:19 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository taler-merchant-demos.

commit 063e68ec063ea29e32da920de83dbdad3fec185e
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Aug 23 11:58:15 2020 +0200

    fix #6510
---
 bin/taler-merchant-demos                  | 26 +++++++++++++++++---------
 talermerchantdemos/blog/blog.py           |  6 ++++++
 talermerchantdemos/donations/donations.py |  5 +++++
 talermerchantdemos/survey/survey.py       |  5 +++++
 4 files changed, 33 insertions(+), 9 deletions(-)

diff --git a/bin/taler-merchant-demos b/bin/taler-merchant-demos
index b4ac156..098416a 100755
--- a/bin/taler-merchant-demos
+++ b/bin/taler-merchant-demos
@@ -59,7 +59,11 @@ def handle_serve_uwsgi(config, whichShop):
         params.extend(["--chmod-socket="+mode])
         os.makedirs(os.path.dirname(spec), exist_ok=True)
     logging.info("launching uwsgi with argv %s", params[1:])
-    os.execlp(*params)
+    try:
+        os.execlp(*params)
+    except:
+        echo "Failed to start uwsgi. Please make sure to install uwsgi for 
Python3."
+        sys.exit(1)
 
 ##
 # This function interprets the 'serve-http' subcommand.
@@ -70,12 +74,16 @@ def handle_serve_http(config, whichShop, port=None):
     if port is None:
         port = config[whichShop]["http_port"].value_int(required=True)
     spec = ":%d" % (port,)
-    os.execlp("uwsgi", "uwsgi",
-              "--master",
-              "--die-on-term",
-              "--log-format", UWSGI_LOGFMT,
-              "--http", spec,
-              "--module", "talermerchantdemos.{}:app".format(whichShop))
+    try:
+        os.execlp("uwsgi", "uwsgi",
+                  "--master",
+                  "--die-on-term",
+                  "--log-format", UWSGI_LOGFMT,
+                  "--http", spec,
+                  "--module", "talermerchantdemos.{}:app".format(whichShop))
+    except:
+        echo "Failed to start uwsgi. Please make sure to install uwsgi for 
Python3."
+        sys.exit(1)
 
 @click.command("Global shop launcher")
 @click.option("--config", help="Configuration file", required=False)
@@ -92,7 +100,7 @@ def demos(config, serve_http, port, serve_uwsgi, which_shop):
     config_obj = TalerConfig.from_file(os.environ.get("TALER_CONFIG_FILE"))
     if serve_http: # port was given
         handle_serve_http(config_obj, which_shop, port)
-        return
-    handle_serve_uwsgi(config_obj, which_shop)
+    else:
+        handle_serve_uwsgi(config_obj, which_shop)
 
 demos()
diff --git a/talermerchantdemos/blog/blog.py b/talermerchantdemos/blog/blog.py
index 61c0131..cf14acb 100644
--- a/talermerchantdemos/blog/blog.py
+++ b/talermerchantdemos/blog/blog.py
@@ -31,6 +31,12 @@ from taler.util.talerconfig import TalerConfig
 from ..blog.content import ARTICLES, get_article_file, get_image_file
 from talermerchantdemos.httpcommon import backend_get, backend_post
 
+if not sys.version_info.major == 3 and sys.version_info.minor >= 6:
+    print("Python 3.6 or higher is required.")
+    print("You are using Python {}.{}.".format(sys.version_info.major, 
sys.version_info.minor))
+    sys.exit(1)
+
+
 BASE_DIR = os.path.dirname(os.path.abspath(__file__))
 app = flask.Flask(__name__, template_folder=BASE_DIR)
 app.secret_key = base64.b64encode(os.urandom(64)).decode("utf-8")
diff --git a/talermerchantdemos/donations/donations.py 
b/talermerchantdemos/donations/donations.py
index 175cbe2..d02bfa3 100644
--- a/talermerchantdemos/donations/donations.py
+++ b/talermerchantdemos/donations/donations.py
@@ -29,6 +29,11 @@ from taler.util.talerconfig import TalerConfig
 from urllib.parse import urljoin
 from ..httpcommon import backend_post, backend_get
 
+if not sys.version_info.major == 3 and sys.version_info.minor >= 6:
+    print("Python 3.6 or higher is required.")
+    print("You are using Python {}.{}.".format(sys.version_info.major, 
sys.version_info.minor))
+    sys.exit(1)
+
 LOGGER = logging.getLogger(__name__)
 
 BASE_DIR = os.path.dirname(os.path.abspath(__file__))
diff --git a/talermerchantdemos/survey/survey.py 
b/talermerchantdemos/survey/survey.py
index 25b97ad..ef8e946 100644
--- a/talermerchantdemos/survey/survey.py
+++ b/talermerchantdemos/survey/survey.py
@@ -27,6 +27,11 @@ import traceback
 from taler.util.talerconfig import TalerConfig
 from ..httpcommon import backend_get, backend_post
 
+if not sys.version_info.major == 3 and sys.version_info.minor >= 6:
+    print("Python 3.6 or higher is required.")
+    print("You are using Python {}.{}.".format(sys.version_info.major, 
sys.version_info.minor))
+    sys.exit(1)
+
 BASE_DIR = os.path.dirname(os.path.abspath(__file__))
 app = flask.Flask(__name__, template_folder=BASE_DIR)
 app.debug = True

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]