[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-merchant-demos] branch master updated: ensure valid shop na
From: |
gnunet |
Subject: |
[taler-taler-merchant-demos] branch master updated: ensure valid shop name |
Date: |
Mon, 12 Oct 2020 13:01:03 +0200 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository taler-merchant-demos.
The following commit(s) were added to refs/heads/master by this push:
new 16de66f ensure valid shop name
16de66f is described below
commit 16de66ffb8469d59f48f06c611b2ea62832b7bdf
Author: MS <ms@taler.net>
AuthorDate: Mon Oct 12 13:00:52 2020 +0200
ensure valid shop name
---
bin/taler-merchant-demos | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/bin/taler-merchant-demos b/bin/taler-merchant-demos
index ade40cf..e7c3821 100755
--- a/bin/taler-merchant-demos
+++ b/bin/taler-merchant-demos
@@ -92,8 +92,7 @@ def handle_serve_http(config, which_shop, port=None):
def handle_serve_from_config(config_obj, which_shop):
try:
if config_obj.value_string(which_shop, "serve", required=True).lower()
== "http":
- http_port = config_obj.value_int(which_shop, "port")
- return handle_serve_http(config_obj, which_shop, http_port)
+ return handle_serve_http(config_obj, which_shop)
handle_serve_uwsgi(config_obj, which_shop)
except ConfigurationError as ce:
print(ce)
@@ -104,12 +103,12 @@ def handle_serve_from_config(config_obj, which_shop):
@click.option("--http-port", help="HTTP port to serve (if not given, serving
comes from config)", required=False, type=int)
@click.argument("which-shop")
def demos(config, http_port, which_shop):
- """
- WHICH_SHOP is one of: blog, donations, survey or landing.
- """
- if config:
- os.environ["TALER_CONFIG_FILE"] = config
- config_obj = TalerConfig.from_file(os.environ.get("TALER_CONFIG_FILE"))
+ """WHICH_SHOP is one of: blog, donations, survey or landing."""
+
+ if which_shop not in ["blog", "donations", "survey"]:
+ print("Please use a valid shop name: blog, donations, survey.")
+ sys.exit(1)
+ config_obj = TalerConfig.from_file(config)
if http_port:
return handle_serve_http(config_obj, which_shop, http_port)
handle_serve_from_config(config_obj, which_shop)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-taler-merchant-demos] branch master updated: ensure valid shop name,
gnunet <=