diff options
author | Cédric Bonhomme <kimble.mandel@gmail.com> | 2012-12-30 21:53:09 +0100 |
---|---|---|
committer | Cédric Bonhomme <kimble.mandel@gmail.com> | 2012-12-30 21:53:09 +0100 |
commit | ea3f5fc2833ec760bf3c9e1307e999a9a3042408 (patch) | |
tree | 66f55fa65faa598ea8fdd96ba3b7bfe9e2045128 | |
parent | Removed unescape function. (diff) | |
download | newspipe-ea3f5fc2833ec760bf3c9e1307e999a9a3042408.tar.gz newspipe-ea3f5fc2833ec760bf3c9e1307e999a9a3042408.tar.bz2 newspipe-ea3f5fc2833ec760bf3c9e1307e999a9a3042408.zip |
Bugfix in export.py for export_txt().
-rw-r--r-- | source/export.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/export.py b/source/export.py index 10f4cd80..c29c9f22 100644 --- a/source/export.py +++ b/source/export.py @@ -112,14 +112,14 @@ def export_txt(mongo_db): for feed in feeds: # creates folder for each stream folder = conf.path + "/var/export/txt/" + \ - utils.normalize_filename(feed["feed_title"].strip().replace(':', '').lower().encode('utf-8')) + utils.normalize_filename(feed["feed_title"].strip().replace(':', '').lower()) try: os.makedirs(folder) except OSError: # directories already exists (not a problem) pass - for article in mongo_db.get_articles_from_collection(feed["feed_id"]): + for article in mongo_db.get_articles(feed_id=feed["feed_id"]): name = article["article_date"].ctime().strip().replace(' ', '_') name = os.path.normpath(folder + "/" + name + ".txt") @@ -127,7 +127,7 @@ def export_txt(mongo_db): content += utils.clear_string(article["article_content"]) with open(name, "w") as f: - f.write(content.encode('utf-8')) + f.write(content) def export_epub(mongo_db): """ |