aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/export.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyaggr3g470r/export.py')
-rw-r--r--pyaggr3g470r/export.py27
1 files changed, 1 insertions, 26 deletions
diff --git a/pyaggr3g470r/export.py b/pyaggr3g470r/export.py
index 9d03f42b..97377ad9 100644
--- a/pyaggr3g470r/export.py
+++ b/pyaggr3g470r/export.py
@@ -195,29 +195,4 @@ def export_html(feeds):
shutil.rmtree(webzine_root)
with open(conf.PATH + "/pyaggr3g470r/var/export/" + archive_file_name, 'r') as export_file:
- return export_file.read(), archive_file_name
-
-def export_txt(mongo_db):
- """
- Export the articles given in parameter in text files.
- """
- feeds = mongo_db.get_all_feeds()
- for feed in feeds:
- # creates folder for each stream
- folder = conf.PATH + "/var/export/txt/" + \
- 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(feed_id=feed["feed_id"]):
- name = article["article_date"].ctime().strip().replace(' ', '_')
- name = os.path.normpath(folder + "/" + name + ".txt")
-
- content = "Title: " + article["article_title"] + "\n\n\n"
- content += utils.clear_string(article["article_content"])
-
- with open(name, "w") as f:
- f.write(content) \ No newline at end of file
+ return export_file.read(), archive_file_name \ No newline at end of file
bgstack15