summaryrefslogtreecommitdiff
path: root/taler-bank-manage.in
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2019-03-13 14:58:07 +0100
committerMarcello Stanisci <stanisci.m@gmail.com>2019-03-13 14:58:07 +0100
commit4d5394f944a011e5259731cedf0a936613332507 (patch)
tree5a88f77cfb654d7e51fe5b961d39f43c18b8197e /taler-bank-manage.in
parent35ee6d99923ad0729b77059762419ed20a9250ae (diff)
downloadbank-4d5394f944a011e5259731cedf0a936613332507.tar.gz
bank-4d5394f944a011e5259731cedf0a936613332507.tar.bz2
bank-4d5394f944a011e5259731cedf0a936613332507.zip
Doxygen.
Commenting the main script 'taler-bank-manage', taking care of excluding the global vairables as they have little use for the reader. Also worth to note: arguments to functions given after newline get interpreted as global variables by Doxygen.
Diffstat (limited to 'taler-bank-manage.in')
-rw-r--r--taler-bank-manage.in62
1 files changed, 55 insertions, 7 deletions
diff --git a/taler-bank-manage.in b/taler-bank-manage.in
index ac3fc47..0c1b8b5 100644
--- a/taler-bank-manage.in
+++ b/taler-bank-manage.in
@@ -1,9 +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 CLI tool to manage all the bank's tasks.
-"""
-Stand-alone script to manage
-the GNU Taler bank.
-"""
+#!/usr/bin/env python3
import argparse
import django
@@ -20,11 +36,20 @@ site.addsitedir("%s/lib/python%d.%d/site-packages" % (
sys.version_info.major,
sys.version_info.minor))
+## Not commenting global variables, at least for now.
+# @cond
LOGGER = logging.getLogger(__name__)
# No perfect match to our logging format, but good enough ...
UWSGI_LOGFMT = "%(ltime) %(proto) %(method) %(uri) %(proto) => %(status)"
-
+## @endcond
+
+##
+# This function interprets the 'django' subcommand.
+# This command usually manages database tasks, and in
+# general what is not related to running the bank.
+#
+# @param args command line options.
def handle_django(args):
django.setup()
# always run 'migrate' first, in case a virgin db is being used.
@@ -32,7 +57,11 @@ def handle_django(args):
from django.core.management import execute_from_command_line
execute_from_command_line([sys.argv[0] + " django"] + args.command)
-
+##
+# 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):
import django
django.setup()
@@ -54,6 +83,15 @@ def handle_serve_http(args):
os.execlp(*params)
+
+
+##
+# 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):
django.setup()
call_command('migrate')
@@ -79,15 +117,24 @@ def handle_serve_uwsgi(args):
logging.info("launching uwsgi with argv %s", params[1:])
os.execlp(*params)
+##
+# Currently deprecated.
def handle_sampledata():
django.setup()
call_command('sample_donations')
+
+##
+# Interprets the '--config' option.
+#
+# @param args command line options.
def handle_config(args):
TC.from_file(args.config)
TC.dump()
+## Not commenting global variables, at least for now.
+# @cond
PARSER = argparse.ArgumentParser()
PARSER.set_defaults(func=None)
PARSER.add_argument('--config', '-c', help="configuration file to use",
@@ -132,3 +179,4 @@ try:
except django.db.utils.OperationalError:
LOGGER.error("Your database has serious problems. Does it exist?")
sys.exit(4)
+## @endcond