diff options
author | cedricbonhomme <devnull@localhost> | 2011-10-25 11:57:52 +0200 |
---|---|---|
committer | cedricbonhomme <devnull@localhost> | 2011-10-25 11:57:52 +0200 |
commit | 4866a0445c374d0443cc7d9102c801489caab51e (patch) | |
tree | 24a7cf2596edb6df48c345d813407d66bf7a5bd8 /export.py | |
parent | Added comments. (diff) | |
download | newspipe-4866a0445c374d0443cc7d9102c801489caab51e.tar.gz newspipe-4866a0445c374d0443cc7d9102c801489caab51e.tar.bz2 newspipe-4866a0445c374d0443cc7d9102c801489caab51e.zip |
Simple HTML export has been replaced by Webzine HTML export.
Diffstat (limited to 'export.py')
-rw-r--r-- | export.py | 34 |
1 files changed, 3 insertions, 31 deletions
@@ -30,7 +30,8 @@ __license__ = "GPLv3" # it is possible to export the database of articles in different formats: # - simple HTML webzine; # - text file; -# - html file. +# - ePub file; +# - PDF file. # import os @@ -53,7 +54,7 @@ htmlfooter = '<p>This software is under GPLv3 license. You are welcome to copy, -def export_webzine(feeds): +def export_html(feeds): """ Export the articles given in parameter in a simple Webzine. """ @@ -128,35 +129,6 @@ def export_txt(feeds): content += utils.clear_string(article.article_description) with open(name, "w") as f: - f.write(content) - -def export_html(feeds): - """ - Export the articles given in parameter in HTML files. - """ - for feed in feeds.values(): - # creates folder for each stream - folder = utils.path + "/var/export/html/" + \ - 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 feed.articles.values(): - name = article.article_date.strip().replace(' ', '_') - name = os.path.normpath(folder + "/" + name + ".html") - - content = htmlheader - content += '\n<div style="width: 50%; overflow:hidden; text-align: justify; margin:0 auto">\n' - content += """<h1><a href="%s">%s</a></h1><br />""" % \ - (article.article_link, article.article_title) - content += article.article_description - content += "</div>\n<hr />\n" - content += htmlfooter - - with open(name, "w") as f: f.write(content) def export_epub(feeds): |