diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2013-12-08 13:54:23 +0100 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2013-12-08 13:54:23 +0100 |
commit | 59f112979030b7c438bff85732111c476e08edff (patch) | |
tree | df60357ff4f8159c0c05b437f27396b125eb1ecd | |
parent | It is now possible to export all articles in a simple HTML site. The result i... (diff) | |
download | newspipe-59f112979030b7c438bff85732111c476e08edff.tar.gz newspipe-59f112979030b7c438bff85732111c476e08edff.tar.bz2 newspipe-59f112979030b7c438bff85732111c476e08edff.zip |
The archive is now generated after all articles.
-rw-r--r-- | pyaggr3g470r/export.py | 6 |
1 files changed, 0 insertions, 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 += "<h1>List of feeds</h1>\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 += "</ul>\n" index += "<p>" + time.strftime("Generated on %d %b %Y at %H:%M.") + "</p>\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/")) |