From bb4c43da40b16d14275f465b925816b16f5ac5fe Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Fri, 18 Jan 2013 11:03:17 +0100 Subject: Updated webzine export: display the number of exported articles. --- source/export.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/source/export.py b/source/export.py index 6db69a56..77d2d24f 100644 --- a/source/export.py +++ b/source/export.py @@ -20,9 +20,9 @@ # along with this program. If not, see __author__ = "Cedric Bonhomme" -__version__ = "$Revision: 0.2 $" +__version__ = "$Revision: 0.3 $" __date__ = "$Date: 2011/10/24 $" -__revision__ = "$Date: 2012/05/01 $" +__revision__ = "$Date: 2013/01/18 $" __copyright__ = "Copyright (c) Cedric Bonhomme" __license__ = "GPLv3" @@ -41,14 +41,14 @@ import hashlib import conf import utils -htmlheader = '\n' + \ +htmlheader = '\n' + \ '' + \ - '\n\tpyAggr3g470r - News aggregator\n' + \ + '\n\tpyAggr3g470r\n' + \ '\t' + \ '\n\t\n' + \ '\n' -htmlfooter = '

This software is under GPLv3 license. You are welcome to copy, modify or' + \ +htmlfooter = '


\n

This software is under GPLv3 license. You are welcome to copy, modify or' + \ ' redistribute the source code according to the' + \ ' GPLv3 license.

\n' + \ '\n' @@ -57,9 +57,10 @@ def export_html(mongo_db): """ Export the articles given in parameter in a simple Webzine. """ + nb_articles = format(mongo_db.nb_articles(), ",d") feeds = mongo_db.get_all_feeds() index = htmlheader - index += "
\n\n
\n" + index += """

Total: %s articles.

\n""" % (nb_articles,) index += htmlfooter with open(conf.path + "/var/export/webzine/" + "index.html", "w") as f: f.write(index) -- cgit