aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2013-12-08 14:22:19 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2013-12-08 14:22:19 +0100
commit55c924ea1e338a76531a60251903cbc8b306548e (patch)
tree3da0454b3495051c87db76a1e2c928526ad2c6e9
parentThe name of the archive is composed of the current date. (diff)
downloadnewspipe-55c924ea1e338a76531a60251903cbc8b306548e.tar.gz
newspipe-55c924ea1e338a76531a60251903cbc8b306548e.tar.bz2
newspipe-55c924ea1e338a76531a60251903cbc8b306548e.zip
Removed export_txt functionality.
-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