diff options
author | Marcello Stanisci <stanisci.m@gmail.com> | 2019-03-13 15:23:57 +0100 |
---|---|---|
committer | Marcello Stanisci <stanisci.m@gmail.com> | 2019-03-13 15:23:57 +0100 |
commit | 688a79977b797b137694c3887bca2672502ab482 (patch) | |
tree | 1ec6af5b4f51902be6c8b7cd70cd61f9757cf966 | |
parent | e1c639bdf2ff1b3e5db4efd26ca7182c5c91f8ae (diff) | |
download | donations-688a79977b797b137694c3887bca2672502ab482.tar.gz donations-688a79977b797b137694c3887bca2672502ab482.tar.bz2 donations-688a79977b797b137694c3887bca2672502ab482.zip |
Doxygen.
Commenting the standalone launcher script.
-rw-r--r-- | Doxyfile | 10 | ||||
-rw-r--r-- | taler-merchant-donations.in | 46 |
2 files changed, 46 insertions, 10 deletions
@@ -43,7 +43,7 @@ OPTIMIZE_OUTPUT_FOR_C = NO OPTIMIZE_OUTPUT_JAVA = NO OPTIMIZE_FOR_FORTRAN = NO OPTIMIZE_OUTPUT_VHDL = NO -EXTENSION_MAPPING = +EXTENSION_MAPPING = in=Python MARKDOWN_SUPPORT = YES TOC_INCLUDE_HEADINGS = 0 AUTOLINK_SUPPORT = YES @@ -61,7 +61,7 @@ LOOKUP_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- -EXTRACT_ALL = NO +EXTRACT_ALL = YES EXTRACT_PRIVATE = NO EXTRACT_PACKAGE = NO EXTRACT_STATIC = NO @@ -94,7 +94,7 @@ ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 SHOW_USED_FILES = YES SHOW_FILES = YES -SHOW_NAMESPACES = YES +SHOW_NAMESPACES = NO FILE_VERSION_FILTER = LAYOUT_FILE = CITE_BIB_FILES = @@ -114,9 +114,9 @@ WARN_LOGFILE = #--------------------------------------------------------------------------- INPUT = INPUT_ENCODING = UTF-8 -FILE_PATTERNS = *.py +FILE_PATTERNS = *.py *.in RECURSIVE = YES -EXCLUDE = +EXCLUDE = Makefile.in EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = EXCLUDE_SYMBOLS = diff --git a/taler-merchant-donations.in b/taler-merchant-donations.in index 19d0d9b..678a2b9 100644 --- a/taler-merchant-donations.in +++ b/taler-merchant-donations.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 donations site. -""" -Stand-alone script to manage the GNU Taler donations frontend. -""" +#!/usr/bin/env python3 import argparse import sys @@ -18,11 +35,19 @@ site.addsitedir("%s/lib/python%d.%d/site-packages" % ( sys.version_info.major, sys.version_info.minor)) +## @cond 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 donations HTTP service. +# +# @param args command line options. def handle_serve_http(args): port = args.port if port is None: @@ -35,6 +60,14 @@ def handle_serve_http(args): "--http", spec, "--wsgi-file", "@prefix@/share/taler/frontend-donations.wsgi") + +## +# This function interprets the 'serve-uwsgi' subcommand. +# The effect is to launch the donations UWSGI service. This +# type of service is usually used when the HTTP donations 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["donations"]["uwsgi_serve"].value_string(required=True).lower() @@ -57,7 +90,7 @@ def handle_serve_uwsgi(args): os.execlp(*params) - +## @cond PARSER = argparse.ArgumentParser() PARSER.set_defaults(func=None) PARSER.add_argument('--config', '-c', @@ -75,6 +108,9 @@ 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) |