From fda7347b85f11a76513a41fd611437c52a5ba45b Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Sat, 19 Jan 2013 14:44:45 +0100 Subject: Minor fixes to the HTML source code of the webzine. --- source/export.py | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'source') diff --git a/source/export.py b/source/export.py index d1d3a794..4bec8089 100644 --- a/source/export.py +++ b/source/export.py @@ -40,7 +40,7 @@ import os import conf import utils -htmlheader = """ +HTML_HEADER = """ pyAggr3g470r @@ -62,12 +62,16 @@ htmlheader = """ .content{margin:1.00em 1.00em} -""" + +""" -htmlfooter = '\n
\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' +HTML_FOOTER = """
+

pyAggr3g470r is under GPLv3 license. +You are welcome to copy, modify or redistribute the source code according to the +GPLv3 license.

+ + +""" def export_html(mongo_db): """ @@ -75,7 +79,7 @@ def export_html(mongo_db): """ nb_articles = format(mongo_db.nb_articles(), ",d") feeds = mongo_db.get_all_feeds() - index = htmlheader + index = HTML_HEADER index += "\n

List of feeds

\n" index += """

%s articles.

\n\n
\n" - index += htmlfooter + index += HTML_FOOTER with open(conf.path + "/var/export/webzine/" + "index.html", "w") as f: f.write(index) @@ -196,13 +200,13 @@ def export_pdf(feeds): name = article.article_date.strip().replace(' ', '_') name = os.path.normpath(folder + "/" + name + ".pdf") - content = htmlheader + content = HTML_HEADER content += '\n
\n' content += """

%s


""" % \ (article.article_link, article.article_title) content += article.article_description content += "
\n
\n" - content += htmlfooter + content += HTML_FOOTER try: pdf = pisa.CreatePDF(StringIO.StringIO(content), file(name, "wb")) -- cgit