aboutsummaryrefslogtreecommitdiff
path: root/source/export.py
diff options
context:
space:
mode:
authorCédric Bonhomme <kimble.mandel@gmail.com>2012-12-30 21:42:07 +0100
committerCédric Bonhomme <kimble.mandel@gmail.com>2012-12-30 21:42:07 +0100
commit084820a7c600ca458b9f98d34db1fb255a32398b (patch)
treeabaf5cd2ce5372418db3b689e3c10bb3c745e648 /source/export.py
parentMinor improvements to the /feed page. (diff)
downloadnewspipe-084820a7c600ca458b9f98d34db1fb255a32398b.tar.gz
newspipe-084820a7c600ca458b9f98d34db1fb255a32398b.tar.bz2
newspipe-084820a7c600ca458b9f98d34db1fb255a32398b.zip
Bugfix in export.py for export_html().
Diffstat (limited to 'source/export.py')
-rw-r--r--source/export.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/export.py b/source/export.py
index f2fbd729..10f4cd80 100644
--- a/source/export.py
+++ b/source/export.py
@@ -74,7 +74,7 @@ def export_html(mongo_db):
(feed["feed_id"], feed["feed_title"])
posts = htmlheader
- for article in mongo_db.get_articles_from_collection(feed["feed_id"]):
+ for article in mongo_db.get_articles(feed_id=feed["feed_id"]):
post_file_name = os.path.normpath(feed_folder + "/" + article["article_id"] + ".html")
feed_index = os.path.normpath(feed_folder + "/index.html")
@@ -93,16 +93,16 @@ def export_html(mongo_db):
a_post += "<hr />\n" + htmlfooter
with open(post_file_name, "w") as f:
- f.write(a_post.encode('utf-8'))
+ f.write(a_post)
posts += htmlfooter
with open(feed_index, "w") as f:
- f.write(posts.encode('utf-8'))
+ f.write(posts)
index += "\n</ul>\n<br />"
index += htmlfooter
with open(conf.path + "/var/export/webzine/" + "index.html", "w") as f:
- f.write(index.encode('utf-8'))
+ f.write(index)
def export_txt(mongo_db):
"""
bgstack15