aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/export.py8
-rwxr-xr-xsource/utils.py6
2 files changed, 7 insertions, 7 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):
"""
diff --git a/source/utils.py b/source/utils.py
index a2f3dfb6..f6cd93d1 100755
--- a/source/utils.py
+++ b/source/utils.py
@@ -126,8 +126,8 @@ def strip_accents(text, encoding):
>>> print strip_accents("déjà", "utf-8")
deja
"""
- unicode_text= unicodedata.normalize('NFD', text.decode(encoding))
- return filter(not_combining, unicode_text).encode(encoding)
+ unicode_text= unicodedata.normalize('NFD', text)
+ return filter(not_combining, unicode_text)
def normalize_filename(name):
"""
@@ -137,7 +137,7 @@ def normalize_filename(name):
file_name = re.sub("[\s.]", "_", file_name)
file_name = file_name.strip('_')
file_name = file_name.strip('.')
- file_name = strip_accents(file_name, "utf-8")
+ #file_name = strip_accents(file_name, "utf-8")
return os.path.normpath(file_name)
def load_stop_words():
bgstack15