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 | |
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.
-rw-r--r-- | export.py | 34 | ||||
-rwxr-xr-x | pyAggr3g470r.py | 3 |
2 files changed, 4 insertions, 33 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): diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py index 0a8ba4a1..d2d6ede7 100755 --- a/pyAggr3g470r.py +++ b/pyAggr3g470r.py @@ -280,8 +280,7 @@ class Root: # Export functions html += "<h1>Export articles</h1>\n\n" html += """<form method=get action="/export/"><select name="export_method">\n""" - html += """\t<option value="export_webzine" selected='selected'>Simple Webzine</option>\n""" - html += """\t<option value="export_html">HTML</option>\n""" + html += """\t<option value="export_html" selected='selected'>HTML (simple Webzine)</option>\n""" html += """\t<option value="export_epub">ePub</option>\n""" html += """\t<option value="export_pdf">PDF</option>\n""" html += """\t<option value="export_txt">Text</option>\n""" |