gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-donations] branch stable updated (87e8e0b -> ebb7b6c


From: gnunet
Subject: [GNUnet-SVN] [taler-donations] branch stable updated (87e8e0b -> ebb7b6c)
Date: Fri, 29 Mar 2019 18:36:25 +0100

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

marcello pushed a change to branch stable
in repository donations.

 discard 87e8e0b  Hot-fix #5538.
     add f1c5d63  changelog
     add 299e812  Restore back-office link
     add 874fad1  Fix prefilled field autofocus.
     add e3eb0d5  4809.
     add a2c904d  gitignore
     add 9cdb2ec  Update submodule
     add 846b55b  Ignore "dirty" submodule
     add e7c7073  fix HTML
     add 654eff9  Doxyfile
     add a3e86af  Instruct doxygen to crawl recursively.
     add e1c639b  Doxygen-commenting the main files.
     add 688a799  Doxygen.
     add aa6229d  fix pip3
     add 0ca8992  fix shebang
     new ebb7b6c  Hot-fix #5538.

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (87e8e0b)
            \
             N -- N -- N   refs/heads/stable (ebb7b6c)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .gitignore                                         |  16 +
 .gitmodules                                        |   3 +-
 ChangeLog                                          |   3 +
 Doxyfile                                           | 331 +++++++++++++++++++++
 Makefile.in                                        |   4 +-
 configure.ac                                       |  10 +
 setup.py                                           |   4 -
 taler-merchant-donations.in                        |  44 ++-
 talerdonations/donations/donations.py              |  86 +++++-
 talerdonations/donations/static/web-common         |   2 +-
 talerdonations/donations/templates/base.html       |   1 +
 talerdonations/donations/templates/index.html      |   2 +-
 talerdonations/donations/templates/javascript.html |  47 +--
 talerdonations/tests.py                            |  20 ++
 14 files changed, 534 insertions(+), 39 deletions(-)
 create mode 100644 .gitignore
 create mode 100644 ChangeLog
 create mode 100644 Doxyfile

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..a0630f3
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,16 @@
+doxygen-doc/
+.eggs/
+Makefile
+aclocal.m4
+autom4te.cache/
+compile
+config.log
+config.status
+configure
+frontend-donations.wsgi
+install-sh
+missing
+taler-merchant-donations
+talerdonations.egg-info/
+talerdonations/__pycache__/
+talerdonations/donations/__pycache__/
diff --git a/.gitmodules b/.gitmodules
index 8ff0b29..7ae826b 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,4 @@
 [submodule "talerdonations/donations/static/web-common"]
        path = talerdonations/donations/static/web-common
-       url = git://taler.net/web-common
+       url = git://git.taler.net/web-common
+        ignore = dirty
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..596330b
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,3 @@
+Tue Feb 13 10:26:37 CET 2018
+        Payment logic which is less state-dependant
+        and more mobile-friendly.
diff --git a/Doxyfile b/Doxyfile
new file mode 100644
index 0000000..530157e
--- /dev/null
+++ b/Doxyfile
@@ -0,0 +1,331 @@
+# Doxyfile 1.8.13
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+DOXYFILE_ENCODING      = UTF-8
+PROJECT_NAME           = "taler-donations"
+PROJECT_NUMBER         =
+PROJECT_BRIEF          =
+PROJECT_LOGO           =
+OUTPUT_DIRECTORY       = doxygen-doc/
+CREATE_SUBDIRS         = NO
+ALLOW_UNICODE_NAMES    = NO
+OUTPUT_LANGUAGE        = English
+BRIEF_MEMBER_DESC      = YES
+REPEAT_BRIEF           = YES
+ABBREVIATE_BRIEF       = "The $name class" \
+                         "The $name widget" \
+                         "The $name file" \
+                         is \
+                         provides \
+                         specifies \
+                         contains \
+                         represents \
+                         a \
+                         an \
+                         the
+ALWAYS_DETAILED_SEC    = NO
+INLINE_INHERITED_MEMB  = NO
+FULL_PATH_NAMES        = YES
+STRIP_FROM_PATH        =
+STRIP_FROM_INC_PATH    =
+SHORT_NAMES            = NO
+JAVADOC_AUTOBRIEF      = NO
+QT_AUTOBRIEF           = NO
+MULTILINE_CPP_IS_BRIEF = NO
+INHERIT_DOCS           = YES
+SEPARATE_MEMBER_PAGES  = NO
+TAB_SIZE               = 4
+ALIASES                =
+TCL_SUBST              =
+OPTIMIZE_OUTPUT_FOR_C  = NO
+OPTIMIZE_OUTPUT_JAVA   = NO
+OPTIMIZE_FOR_FORTRAN   = NO
+OPTIMIZE_OUTPUT_VHDL   = NO
+EXTENSION_MAPPING      = in=Python
+MARKDOWN_SUPPORT       = YES
+TOC_INCLUDE_HEADINGS   = 0
+AUTOLINK_SUPPORT       = YES
+BUILTIN_STL_SUPPORT    = NO
+CPP_CLI_SUPPORT        = NO
+SIP_SUPPORT            = NO
+IDL_PROPERTY_SUPPORT   = YES
+DISTRIBUTE_GROUP_DOC   = NO
+GROUP_NESTED_COMPOUNDS = NO
+SUBGROUPING            = YES
+INLINE_GROUPED_CLASSES = NO
+INLINE_SIMPLE_STRUCTS  = NO
+TYPEDEF_HIDES_STRUCT   = NO
+LOOKUP_CACHE_SIZE      = 0
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL            = YES
+EXTRACT_PRIVATE        = NO
+EXTRACT_PACKAGE        = NO
+EXTRACT_STATIC         = NO
+EXTRACT_LOCAL_CLASSES  = YES
+EXTRACT_LOCAL_METHODS  = NO
+EXTRACT_ANON_NSPACES   = NO
+HIDE_UNDOC_MEMBERS     = NO
+HIDE_UNDOC_CLASSES     = NO
+HIDE_FRIEND_COMPOUNDS  = NO
+HIDE_IN_BODY_DOCS      = NO
+INTERNAL_DOCS          = NO
+CASE_SENSE_NAMES       = YES
+HIDE_SCOPE_NAMES       = NO
+HIDE_COMPOUND_REFERENCE= NO
+SHOW_INCLUDE_FILES     = YES
+SHOW_GROUPED_MEMB_INC  = NO
+FORCE_LOCAL_INCLUDES   = NO
+INLINE_INFO            = YES
+SORT_MEMBER_DOCS       = YES
+SORT_BRIEF_DOCS        = NO
+SORT_MEMBERS_CTORS_1ST = NO
+SORT_GROUP_NAMES       = NO
+SORT_BY_SCOPE_NAME     = NO
+STRICT_PROTO_MATCHING  = NO
+GENERATE_TODOLIST      = YES
+GENERATE_TESTLIST      = YES
+GENERATE_BUGLIST       = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS       =
+MAX_INITIALIZER_LINES  = 30
+SHOW_USED_FILES        = YES
+SHOW_FILES             = YES
+SHOW_NAMESPACES        = NO
+FILE_VERSION_FILTER    =
+LAYOUT_FILE            =
+CITE_BIB_FILES         =
+#---------------------------------------------------------------------------
+# Configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET                  = NO
+WARNINGS               = YES
+WARN_IF_UNDOCUMENTED   = YES
+WARN_IF_DOC_ERROR      = YES
+WARN_NO_PARAMDOC       = NO
+WARN_AS_ERROR          = NO
+WARN_FORMAT            = "$file:$line: $text"
+WARN_LOGFILE           =
+#---------------------------------------------------------------------------
+# Configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT                  =
+INPUT_ENCODING         = UTF-8
+FILE_PATTERNS          = *.py *.in
+RECURSIVE              = YES
+EXCLUDE                = Makefile.in
+EXCLUDE_SYMLINKS       = NO
+EXCLUDE_PATTERNS       =
+EXCLUDE_SYMBOLS        =
+EXAMPLE_PATH           =
+EXAMPLE_PATTERNS       = *
+EXAMPLE_RECURSIVE      = NO
+IMAGE_PATH             =
+INPUT_FILTER           =
+FILTER_PATTERNS        =
+FILTER_SOURCE_FILES    = NO
+FILTER_SOURCE_PATTERNS =
+USE_MDFILE_AS_MAINPAGE =
+#---------------------------------------------------------------------------
+# Configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER         = NO
+INLINE_SOURCES         = NO
+STRIP_CODE_COMMENTS    = YES
+REFERENCED_BY_RELATION = NO
+REFERENCES_RELATION    = NO
+REFERENCES_LINK_SOURCE = YES
+SOURCE_TOOLTIPS        = YES
+USE_HTAGS              = NO
+VERBATIM_HEADERS       = YES
+CLANG_ASSISTED_PARSING = NO
+CLANG_OPTIONS          =
+#---------------------------------------------------------------------------
+# Configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX     = YES
+COLS_IN_ALPHA_INDEX    = 5
+IGNORE_PREFIX          =
+#---------------------------------------------------------------------------
+# Configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML          = YES
+HTML_OUTPUT            = html
+HTML_FILE_EXTENSION    = .html
+HTML_HEADER            =
+HTML_FOOTER            =
+HTML_STYLESHEET        =
+HTML_EXTRA_STYLESHEET  =
+HTML_EXTRA_FILES       =
+HTML_COLORSTYLE_HUE    = 220
+HTML_COLORSTYLE_SAT    = 100
+HTML_COLORSTYLE_GAMMA  = 80
+HTML_TIMESTAMP         = NO
+HTML_DYNAMIC_SECTIONS  = NO
+HTML_INDEX_NUM_ENTRIES = 100
+GENERATE_DOCSET        = NO
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
+DOCSET_PUBLISHER_NAME  = Publisher
+GENERATE_HTMLHELP      = NO
+CHM_FILE               =
+HHC_LOCATION           =
+GENERATE_CHI           = NO
+CHM_INDEX_ENCODING     =
+BINARY_TOC             = NO
+TOC_EXPAND             = NO
+GENERATE_QHP           = NO
+QCH_FILE               =
+QHP_NAMESPACE          = org.doxygen.Project
+QHP_VIRTUAL_FOLDER     = doc
+QHP_CUST_FILTER_NAME   =
+QHP_CUST_FILTER_ATTRS  =
+QHP_SECT_FILTER_ATTRS  =
+QHG_LOCATION           =
+GENERATE_ECLIPSEHELP   = NO
+ECLIPSE_DOC_ID         = org.doxygen.Project
+DISABLE_INDEX          = NO
+GENERATE_TREEVIEW      = NO
+ENUM_VALUES_PER_LINE   = 4
+TREEVIEW_WIDTH         = 250
+EXT_LINKS_IN_WINDOW    = NO
+FORMULA_FONTSIZE       = 10
+FORMULA_TRANSPARENT    = YES
+USE_MATHJAX            = NO
+MATHJAX_FORMAT         = HTML-CSS
+MATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest
+MATHJAX_EXTENSIONS     =
+MATHJAX_CODEFILE       =
+SEARCHENGINE           = YES
+SERVER_BASED_SEARCH    = NO
+EXTERNAL_SEARCH        = NO
+SEARCHENGINE_URL       =
+SEARCHDATA_FILE        = searchdata.xml
+EXTERNAL_SEARCH_ID     =
+EXTRA_SEARCH_MAPPINGS  =
+#---------------------------------------------------------------------------
+# Configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX         = NO
+LATEX_OUTPUT           = latex
+LATEX_CMD_NAME         = latex
+MAKEINDEX_CMD_NAME     = makeindex
+COMPACT_LATEX          = NO
+PAPER_TYPE             = a4
+EXTRA_PACKAGES         =
+LATEX_HEADER           =
+LATEX_FOOTER           =
+LATEX_EXTRA_STYLESHEET =
+LATEX_EXTRA_FILES      =
+PDF_HYPERLINKS         = YES
+USE_PDFLATEX           = YES
+LATEX_BATCHMODE        = NO
+LATEX_HIDE_INDICES     = NO
+LATEX_SOURCE_CODE      = NO
+LATEX_BIB_STYLE        = plain
+LATEX_TIMESTAMP        = NO
+#---------------------------------------------------------------------------
+# Configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF           = NO
+RTF_OUTPUT             = rtf
+COMPACT_RTF            = NO
+RTF_HYPERLINKS         = NO
+RTF_STYLESHEET_FILE    =
+RTF_EXTENSIONS_FILE    =
+RTF_SOURCE_CODE        = NO
+#---------------------------------------------------------------------------
+# Configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN           = NO
+MAN_OUTPUT             = man
+MAN_EXTENSION          = .3
+MAN_SUBDIR             =
+MAN_LINKS              = NO
+#---------------------------------------------------------------------------
+# Configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML           = NO
+XML_OUTPUT             = xml
+XML_PROGRAMLISTING     = YES
+#---------------------------------------------------------------------------
+# Configuration options related to the DOCBOOK output
+#---------------------------------------------------------------------------
+GENERATE_DOCBOOK       = NO
+DOCBOOK_OUTPUT         = docbook
+DOCBOOK_PROGRAMLISTING = NO
+#---------------------------------------------------------------------------
+# Configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF   = NO
+#---------------------------------------------------------------------------
+# Configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD       = NO
+PERLMOD_LATEX          = NO
+PERLMOD_PRETTY         = YES
+PERLMOD_MAKEVAR_PREFIX =
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING   = YES
+MACRO_EXPANSION        = NO
+EXPAND_ONLY_PREDEF     = NO
+SEARCH_INCLUDES        = YES
+INCLUDE_PATH           =
+INCLUDE_FILE_PATTERNS  =
+PREDEFINED             =
+EXPAND_AS_DEFINED      =
+SKIP_FUNCTION_MACROS   = YES
+#---------------------------------------------------------------------------
+# Configuration options related to external references
+#---------------------------------------------------------------------------
+TAGFILES               =
+GENERATE_TAGFILE       =
+ALLEXTERNALS           = NO
+EXTERNAL_GROUPS        = YES
+EXTERNAL_PAGES         = YES
+PERL_PATH              = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS         = NO
+MSCGEN_PATH            =
+DIA_PATH               =
+HIDE_UNDOC_RELATIONS   = YES
+HAVE_DOT               = YES
+DOT_NUM_THREADS        = 0
+DOT_FONTNAME           = Helvetica
+DOT_FONTSIZE           = 10
+DOT_FONTPATH           =
+CLASS_GRAPH            = YES
+COLLABORATION_GRAPH    = YES
+GROUP_GRAPHS           = YES
+UML_LOOK               = NO
+UML_LIMIT_NUM_FIELDS   = 10
+TEMPLATE_RELATIONS     = NO
+INCLUDE_GRAPH          = YES
+INCLUDED_BY_GRAPH      = YES
+CALL_GRAPH             = NO
+CALLER_GRAPH           = NO
+GRAPHICAL_HIERARCHY    = YES
+DIRECTORY_GRAPH        = YES
+DOT_IMAGE_FORMAT       = png
+INTERACTIVE_SVG        = NO
+DOT_PATH               =
+DOTFILE_DIRS           =
+MSCFILE_DIRS           =
+DIAFILE_DIRS           =
+PLANTUML_JAR_PATH      =
+PLANTUML_CFG_FILE      =
+PLANTUML_INCLUDE_PATH  =
+DOT_GRAPH_MAX_NODES    = 50
+MAX_DOT_GRAPH_DEPTH    = 0
+DOT_TRANSPARENT        = NO
+DOT_MULTI_TARGETS      = NO
+GENERATE_LEGEND        = YES
+DOT_CLEANUP            = YES
diff --git a/Makefile.in b/Makefile.in
index c7b8750..5cb170b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -40,9 +40,9 @@ devinstall: $(templates) install-data
 # install into prefix
 .PHONY: install
 install: $(templates) install-data
-       @pip3 install . --install-option="address@hidden@"
+       @pip3 install . @DEBIAN_PIP3_SYSTEM@ --install-option="address@hidden@"
        @# force update when sources changed
-       @pip3 install . --install-option="address@hidden@" --upgrade --no-deps
+       @pip3 install . @DEBIAN_PIP3_SYSTEM@ --install-option="address@hidden@" 
--upgrade --no-deps
        cd talerdonations/donations/static/web-common && make install && cd -
 
 # run testcases
diff --git a/configure.ac b/configure.ac
index 8852d84..c7440be 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,6 +31,16 @@ AC_MSG_RESULT([$VERSION])
 
 AX_COMPARE_VERSION([$VERSION],[lt],[6.0], [AC_MSG_ERROR([Please install 
pip3>=6.0])])
 
+# On Debian systems, we may need to pass "--system" to pip3 to get
+# to the desired installation target directory
+pip3 install --help | grep '\-\-system' >> /dev/null
+if test $? -ne 0;
+then
+   DEBIAN_PIP3_SYSTEM=""
+else
+   DEBIAN_PIP3_SYSTEM="--system"
+fi
+AC_SUBST(DEBIAN_PIP3_SYSTEM)
 
 #
 # Check for tsc
diff --git a/setup.py b/setup.py
index f435e1c..5cddc40 100755
--- a/setup.py
+++ b/setup.py
@@ -16,12 +16,8 @@ setup(name='talerdonations',
               "donations/templates/*.html",
               "donations/static/*.svg",
               "donations/static/*.css",
-              "donations/static/*.js",
-              "donations/static/*.js.tar.gz",
               "donations/static/web-common/*.png",
               "donations/static/web-common/*.css",
-              "donations/static/web-common/*.js",
-              "donations/static/web-common/*.js.tar.gz",
               "donations/static/web-common/*.html",
       ]
       },
diff --git a/taler-merchant-donations.in b/taler-merchant-donations.in
index 19d0d9b..5e3243d 100644
--- a/taler-merchant-donations.in
+++ b/taler-merchant-donations.in
@@ -1,8 +1,25 @@
 #!/usr/bin/env python3
 
-"""
-Stand-alone script to manage the GNU Taler donations frontend.
-"""
+##
+# 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.
 
 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)
diff --git a/talerdonations/donations/donations.py 
b/talerdonations/donations/donations.py
index 6fd35ea..f0f97c5 100644
--- a/talerdonations/donations/donations.py
+++ b/talerdonations/donations/donations.py
@@ -1,3 +1,4 @@
+##
 # This file is part of GNU TALER.
 # Copyright (C) 2014-2016 INRIA
 #
@@ -14,6 +15,7 @@
 #
 # @author Florian Dold
 # @author Marcello Stanisci
+# @brief Implementation of a donations site.
 
 from urllib.parse import urljoin, parse_qsl
 import logging
@@ -41,6 +43,12 @@ APIKEY = 
TC["frontends"]["backend_apikey"].value_string(required=True)
 
 app.config.from_object(__name__)
 
+
+##
+# Extend the templating language with a function
+# that fetches values from the environment.
+#
+# @return the environment-reading function.
 @app.context_processor
 def utility_processor():
     def env(name, default=None):
@@ -48,11 +56,23 @@ def utility_processor():
     return dict(env=env)
 
 
+##
+# Return a error response to the client.
+#
+# @param abort_status_code status code to return along the response.
+# @param params _kw_ arguments to passed verbatim to the templating engine.
 def err_abort(abort_status_code, **params):
     t = flask.render_template("templates/error.html", **params)
     flask.abort(flask.make_response(t, abort_status_code))
 
 
+##
+# Issue a GET request to the backend.
+#
+# @param endpoint the backend endpoint where to issue the request.
+# @param params (dict type of) URL parameters to append to the request.
+# @return the JSON response from the backend, or a error response
+#         if something unexpected happens.
 def backend_get(endpoint, params):
     headers = {"Authorization": "ApiKey " + APIKEY}
     try:
@@ -69,6 +89,14 @@ def backend_get(endpoint, params):
     return response_json
 
 
+##
+# POST a request to the backend, and return a error
+# response if any error occurs.
+#
+# @param endpoint the backend endpoint where to POST
+#        this request.
+# @param json the POST's body.
+# @return the backend response (JSON format).
 def backend_post(endpoint, json):
     headers = {"Authorization": "ApiKey " + APIKEY}
     try:
@@ -86,29 +114,54 @@ def backend_post(endpoint, json):
     return response_json
 
 
+
+##
+# Inspect GET arguments in the look for a parameter.
+#
+# @param name the parameter name to lookup.
+# @return the parameter value, or a error page if not found.
 def expect_parameter(name):
     val = flask.request.args.get(name)
     if not val:
         return err_abort(400, message="parameter '{}' required".format(name))
     return val
 
-
+##
+# "Fallback" exception handler to capture all the unmanaged errors.
+#
+# @param e the Exception object, currently unused.
+# @return flask-native response object carrying the error message
+#         (and execution stack!).
 @app.errorhandler(Exception)
 def internal_error(e):
     return flask.render_template("templates/error.html",
                                  message="Internal error",
                                  stack=traceback.format_exc())
 
-
+##
+# Serve the main index page.
+#
+# @return response object of the index page.
 @app.route("/")
 def index():
     return flask.render_template("templates/index.html", 
merchant_currency=CURRENCY)
 
+##
+# Serve the "/javascript" page.
+#
+# @return response object for the /javascript page.
 @app.route("/javascript")
 def javascript_licensing():
     return flask.render_template("templates/javascript.html")
 
 
+
+##
+# Serve the "/checkout" page.  This page lets the
+# user pick the payment method they want to use,
+# and finally confirm the donation.
+#
+# @return response object for the /checkout page.
 @app.route("/checkout", methods=["GET"])
 def checkout():
     amount = expect_parameter("donation_amount")
@@ -122,11 +175,24 @@ def checkout():
         merchant_currency=CURRENCY)
 
 
+##
+# Serve the page advising the user about the impossibility
+# of further processing the payment method they chose.
+#
+# @return response object about the mentioned impossibility.
 @app.route("/provider-not-supported")
 def provider_not_supported():
     return flask.render_template( "templates/provider-not-supported.html")
 
 
+
+##
+# POST the donation request to the backend.  In particular,
+# it uses the "POST /order" API.
+#
+# @return response object that will redirect the browser to
+#         the fulfillment URL, where all the pay-logic will
+#         happen.
 @app.route("/donate")
 def donate():
     donation_receiver = expect_parameter("donation_receiver")
@@ -148,14 +214,20 @@ def donate():
     return flask.redirect(flask.url_for("fulfillment", 
receiver=donation_receiver, order_id=order_id))
 
 
+
+##
+# Serve the fulfillment page.
+#
+# @param receiver the donation receiver name, that should
+#        correspond to a merchant instance.
+# @return after the wallet sent the payment, the final HTML "congrats"
+#         page is returned; otherwise, the browser will be redirected
+#         to a page that accepts the payment.
 @app.route("/donation/<receiver>")
 def fulfillment(receiver):
     order_id = expect_parameter("order_id")
-    pay_params = dict(
-        instance=receiver,
-        order_id=order_id,
-    )
-
+    pay_params = dict(instance=receiver,
+                      order_id=order_id)
     pay_status = backend_get("check-payment", pay_params)
 
     if pay_status.get("payment_redirect_url"):
diff --git a/talerdonations/donations/static/web-common 
b/talerdonations/donations/static/web-common
index 0a65d59..e9554ba 160000
--- a/talerdonations/donations/static/web-common
+++ b/talerdonations/donations/static/web-common
@@ -1 +1 @@
-Subproject commit 0a65d5985b0474b4597dc2936f5791559c2a8a5a
+Subproject commit e9554baf0f3f880d656284ef5e9089bbd8313464
diff --git a/talerdonations/donations/templates/base.html 
b/talerdonations/donations/templates/base.html
index 60f17da..86f81a9 100644
--- a/talerdonations/donations/templates/base.html
+++ b/talerdonations/donations/templates/base.html
@@ -36,6 +36,7 @@
       <li><a href="{{ env('TALER_ENV_URL_MERCHANT_BLOG', '#') }}">Essay 
Shop</a></li>
       <li><a href="{{ env('TALER_ENV_URL_MERCHANT_DONATIONS', '#') 
}}">Donations</a></li>
       <li><a href="{{ env('TALER_ENV_URL_MERCHANT_SURVEY', '#') 
}}">Tipping/Survey</a></li>
+      <li><a href="{{ env('TALER_ENV_URL_BACKOFFICE', '#') 
}}">Back-office</a></li>
     </ul>
     <p>You can learn more about Taler on our main <a 
href="https://taler.net";>website</a>.</p>
   </div>
diff --git a/talerdonations/donations/templates/index.html 
b/talerdonations/donations/templates/index.html
index b384362..fc956e5 100644
--- a/talerdonations/donations/templates/index.html
+++ b/talerdonations/donations/templates/index.html
@@ -39,7 +39,7 @@ You are paying with an imaginary currency ({{ 
merchant_currency }}).
         <option value="{{ merchant_currency }}:6">5 {{ merchant_currency 
}}</option>
         <option value="{{ merchant_currency }}:10">10 {{ merchant_currency 
}}</option>
       </select>
-      <input type="text" name="donation_donor" value="Anonymous Donor" />
+      <input type="text" name="donation_donor" autofocus onfocus="this.value = 
'Anonymous Donor'" />
       <input type="submit" class="pure-button pure-button-primary" 
value="Donate!" />
     </div>
   </form>
diff --git a/talerdonations/donations/templates/javascript.html 
b/talerdonations/donations/templates/javascript.html
index fa94218..436c186 100644
--- a/talerdonations/donations/templates/javascript.html
+++ b/talerdonations/donations/templates/javascript.html
@@ -1,22 +1,31 @@
 <!-- This file is in the public domain -->
+
 <html>
-<body>
-<table id="jslicense-labels1">
-<tr>
-  <td><a 
href="/static/web-common/taler-wallet-lib.js">taler-wallet-lib.js</a></td>
-  <td><a href="https://www.gnu.org/licenses/lgpl-2.1.html";>LGPL</a></td>
-  <td><a 
href="/static/web-common/taler-wallet-lib.js.tar.gz">taler-wallet-lib.js.tar.gz</a></td>
-</tr>
-<tr>
-  <td><a 
href="/static/web-common/dropdown-navbar_script.js">dropdown-navbar_script.js</a></td>
-  <td><a href="https://www.gnu.org/licenses/lgpl-2.1.html";>LGPL</a></td>
-  <td><a 
href="/static/web-common/dropdown-navbar_script.js">dropdown-navbar_script.js</a></td>
-</tr>
-<tr>
-  <td><a href="/static/web-common/index.js">dropdown-navbar_script.js</a></td>
-  <td><a href="https://www.gnu.org/licenses/lgpl-2.1.html";>LGPL</a></td>
-  <td><a href="/static/web-common/index.js">dropdown-navbar_script.js</a></td>
-</tr>
-</table>
-</body>
+  <head>
+    <title>JavaScript disclaimer.</title>
+  </head>
+  <body>
+    <h3>This site does not use JavaScript.</h3>
+  </body>
 </html>
+
+<!-- The following lines are kept as a template for future inclusion of 
JavaScript files. -->
+
+<!--
+  <html>
+  <body>
+  <table id="jslicense-labels1">
+  <tr>
+    <td><a href="/static/path/to/example0.js">example0.js</a></td>
+    <td><a href="https://www.gnu.org/licenses/lgpl-2.1.html";>LGPL</a></td>
+    <td><a 
href="/static/path/to/example0.js.tar.gz">example0.js.tar.gz</a></td>
+  </tr>
+  <tr>
+    <td><a href="/static/path/to/example1.js">example1.js</a></td>
+    <td><a href="https://www.gnu.org/licenses/lgpl-2.1.html";>LGPL</a></td>
+    <td><a 
href="/static/path/to/example1.js.tar.gz">example1.js.tar.gz</a></td>
+  </tr>
+  </table>
+  </body>
+  </html>
+-->
diff --git a/talerdonations/tests.py b/talerdonations/tests.py
index 9a1365c..c9918c2 100644
--- a/talerdonations/tests.py
+++ b/talerdonations/tests.py
@@ -1,3 +1,21 @@
+##
+# This file is part of GNU TALER.
+# Copyright (C) 2014-2016 INRIA
+#
+# TALER is free software; you can redistribute it and/or modify it under the
+# terms of the GNU Lesser General Public License as published by the Free 
Software
+# Foundation; either version 2.1, 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 Lesser General Public License for more 
details.
+#
+# You should have received a copy of the GNU Lesser General Public License 
along with
+# GNU TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+#
+# @author Marcello Stanisci
+# @brief Donations site test case.
+
 #!/usr/bin/env python3
 
 import unittest
@@ -9,6 +27,8 @@ from talerdonations.talerconfig import TalerConfig
 TC = TalerConfig.from_env()
 CURRENCY = TC["taler"]["currency"].value_string(required=True)
 
+##
+# Main class that gathers all the tests.
 class DonationsTestCase(unittest.TestCase):
     def setUp(self):
         donations.app.testing = True

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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