diff options
author | cedricbonhomme <devnull@localhost> | 2010-05-09 19:27:03 +0200 |
---|---|---|
committer | cedricbonhomme <devnull@localhost> | 2010-05-09 19:27:03 +0200 |
commit | f7cd4ab03a10bc0089840144e4fec98ec7981a10 (patch) | |
tree | 8c9c5c48609d4af95a9037b383ddded8c2df28bc | |
parent | Release 1.3. Export function (HTML, raw text). (diff) | |
download | newspipe-f7cd4ab03a10bc0089840144e4fec98ec7981a10.tar.gz newspipe-f7cd4ab03a10bc0089840144e4fec98ec7981a10.tar.bz2 newspipe-f7cd4ab03a10bc0089840144e4fec98ec7981a10.zip |
Improvements of HTML and text export.
-rwxr-xr-x | css/style.css | 3 | ||||
-rwxr-xr-x | pyAggr3g470r.py | 17 |
2 files changed, 14 insertions, 6 deletions
diff --git a/css/style.css b/css/style.css index 46264279..0de4ca0e 100755 --- a/css/style.css +++ b/css/style.css @@ -59,6 +59,7 @@ table { margin-left: 2em; margin-bottom: 1em; border-collapse: collapse; + text-align: left; } th, td { @@ -69,11 +70,13 @@ th, td { th { vertical-align: bottom; border-bottom: 1px solid black; + text-align: left; } td { vertical-align: top; padding-top: 5px; + text-align: left; } table.border td, table.border th { diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py index 0daf89ca..726c2a1a 100755 --- a/pyAggr3g470r.py +++ b/pyAggr3g470r.py @@ -653,7 +653,7 @@ class Root: html += """<p>Notifications are sent to: <a href="mail:%s">%s</a></p>""" % \ (utils.mail_to, utils.mail_to) html += "\n<hr />\n" + htmlfooter - return html + return html"<h1>" + article[2].encode('utf-8') + "</h1><br /><br />" list_notification.exposed = True @@ -749,25 +749,30 @@ class Root: def export(self, export_method): """ - Export articles stored in the SQLite database in a text files. + Export articles stored in the SQLite database in text files. """ for rss_feed_id in self.feeds.keys(): folder = utils.path + "var/export/" + self.feeds[rss_feed_id][3] + folder = folder.replace(' ', '_') try: os.makedirs(folder) except OSError: - return self.error_page(folder+" already exists.") + return self.error_page(utils.path + "var/export/"+" already exists.\nYou should delete this folder.") for article in self.articles[rss_feed_id]: try: if export_method == "export_HTML": - f = open(folder + "/" + article[2]+ ".html", "w") + name = folder + "/" + article[1]+ ".html" + f = open(name.replace(' ', '_'), "w") content = htmlheader + content += "<h1>" + article[2].encode('utf-8') + "</h1><br />" content += article[4].encode('utf-8') content += "<hr />\n" content += htmlfooter elif export_method == "export_TXT": - f = open(folder + "/" + article[2], "w") - content = utils.remove_html_tags(article[4].encode('utf-8')) + name = folder + "/" + article[1] + ".txt" + f = open(name.replace(' ', '_'), "w") + content = "Title: " + article[2].encode('utf-8') + "\n\n\n" + content += utils.remove_html_tags(article[4].encode('utf-8')) f.write(content) except IOError: pass |