From 59f112979030b7c438bff85732111c476e08edff Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Sun, 8 Dec 2013 13:54:23 +0100 Subject: The archive is now generated after all articles. --- pyaggr3g470r/export.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pyaggr3g470r/export.py b/pyaggr3g470r/export.py index e220bde7..987be217 100644 --- a/pyaggr3g470r/export.py +++ b/pyaggr3g470r/export.py @@ -134,7 +134,6 @@ def export_html(feeds): """ Export the articles given in parameter in a simple Webzine. """ - #tar = tarfile.open(conf.PATH + "/pyaggr3g470r/var/export.tar.gz", "w:gz") nb_articles = format(len(models.Article.objects()), ",d") index = HTML_HEADER("News archive") index += "

List of feeds

\n" @@ -173,23 +172,18 @@ def export_html(feeds): with open(post_file_name, "w") as f: f.write(a_post.encode("utf-8")) - #tar.add(post_file_name) posts += HTML_FOOTER with open(feed_index, "w") as f: f.write(posts.encode("utf-8")) - #tar.add(feed_index) index += "\n" index += "

" + time.strftime("Generated on %d %b %Y at %H:%M.") + "

\n" index += HTML_FOOTER with open(conf.PATH + "/pyaggr3g470r/var/export/webzine/" + "index.html", "w") as f: f.write(index.encode("utf-8")) - #tar.add(conf.PATH + "/pyaggr3g470r/var/export/webzine/" + "index.html") with open(conf.PATH + "/pyaggr3g470r/var/export/webzine/" + "style.css", "w") as f: f.write(CSS.encode("utf-8")) - #tar.add(conf.PATH + "/pyaggr3g470r/var/export/webzine/" + "style.css") - #tar.close() with tarfile.open(conf.PATH + "/pyaggr3g470r/var/export.tar.gz", "w:gz") as tar: tar.add(conf.PATH + "/pyaggr3g470r/var/export/webzine/", arcname=os.path.basename(conf.PATH + "/pyaggr3g470r/var/export/webzine/")) -- cgit