diff options
author | Marcello Stanisci <stanisci.m@gmail.com> | 2019-03-13 15:06:27 +0100 |
---|---|---|
committer | Marcello Stanisci <stanisci.m@gmail.com> | 2019-03-13 15:06:27 +0100 |
commit | da74956caae228c46a8efb85f9b658d6ac80ea09 (patch) | |
tree | c14a832f44ce446f554b8eff82b459dcdc515768 /taler-merchant-blog.in | |
parent | 9de91ef6ded6eb512d8412443a177c46b8f4d8f9 (diff) | |
download | blog-da74956caae228c46a8efb85f9b658d6ac80ea09.tar.gz blog-da74956caae228c46a8efb85f9b658d6ac80ea09.tar.bz2 blog-da74956caae228c46a8efb85f9b658d6ac80ea09.zip |
Doxygen.
Commenting the standalone .in launcher script.
Diffstat (limited to 'taler-merchant-blog.in')
-rw-r--r-- | taler-merchant-blog.in | 44 |
1 files changed, 38 insertions, 6 deletions
diff --git a/taler-merchant-blog.in b/taler-merchant-blog.in index 0b25879..da3873f 100644 --- a/taler-merchant-blog.in +++ b/taler-merchant-blog.in @@ -1,8 +1,25 @@ -#!/usr/bin/env python3 +## +# This file is part of TALER +# (C) 2017 INRIA +# +# TALER is free software; you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public +# License as published by the Free Software Foundation; either +# version 3, or (at your option) any later version. +# +# TALER is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty +# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with TALER; see the file COPYING. If not, +# see <http://www.gnu.org/licenses/> +# +# @author Florian Dold +# @file Standalone script to run the blog. -""" -Stand-alone script to manage the GNU Taler blog frontend. -""" +#!/usr/bin/env python3 import logging import argparse @@ -18,12 +35,20 @@ site.addsitedir("%s/lib/python%d.%d/site-packages" % ( sys.version_info.major, sys.version_info.minor)) +## @cond LOGGER = logging.getLogger(__name__) TC = TalerConfig.from_file(os.environ.get("TALER_CONFIG_FILE")) # No perfect match to our logging format, but good enough ... UWSGI_LOGFMT = "%(ltime) %(proto) %(method) %(uri) %(proto) => %(status)" +## @endcond + +## +# This function interprets the 'serve-http' subcommand. +# The effect it to launch the bank HTTP service. +# +# @param args command line options. def handle_serve_http(args): port = args.port if port is None: @@ -36,6 +61,13 @@ def handle_serve_http(args): "--http", spec, "--wsgi-file", "@prefix@/share/taler/frontend-blog.wsgi") +## +# This function interprets the 'serve-uwsgi' subcommand. +# The effect is to launch the bank UWSGI service. This +# type of service is usually used when the HTTP bank interface +# is accessed via a reverse proxy (like Nginx, for example). +# +# @param command line options. def handle_serve_uwsgi(args): del args # pacify PEP checkers serve_uwsgi = TC["blog"]["uwsgi_serve"].value_string(required=True).lower() @@ -58,8 +90,7 @@ def handle_serve_uwsgi(args): logging.info("launching uwsgi with argv %s", params[1:]) os.execlp(*params) - - +## @cond PARSER = argparse.ArgumentParser() PARSER.set_defaults(func=None) PARSER.add_argument('--config', '-c', @@ -77,6 +108,7 @@ P = SUB.add_parser('serve-uwsgi', help="Serve over UWSGI") P.set_defaults(func=handle_serve_uwsgi) ARGS = PARSER.parse_args() +## @endcond if getattr(ARGS, 'func', None) is None: PARSER.print_help() sys.exit(1) |