From 67d0a8118e5fbf3a86d5652ecea9e2daedb6c12d Mon Sep 17 00:00:00 2001 From: cedricbonhomme Date: Sun, 7 Feb 2010 11:27:09 +0100 Subject: It is now possible to mark all articles as read. --- pyAggr3g470r.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'pyAggr3g470r.py') diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py index d96be7db..0a41b2f2 100644 --- a/pyAggr3g470r.py +++ b/pyAggr3g470r.py @@ -53,6 +53,7 @@ class Root: html += htmlnav html += """
\n""" html += """Fetch all feeds\n
\n""" + html += """Mark all articles as read\n
\n""" html += """Management of feed\n""" html += """
\n""" @@ -246,25 +247,30 @@ class Root: return (dic, dic_info) return (dic, dic_info) - def mark_as_read(self, article_link): + def mark_as_read(self, article_link = "All"): """ - Mark an article as read by setting the value of the field + Mark an (or all) articles as read by setting the value of the field 'article_readed' of the SQLite database to 1. """ try: conn = sqlite3.connect("./var/feed.db", isolation_level = None) c = conn.cursor() - c.execute("UPDATE rss_feed SET article_readed=1 WHERE article_link='" + article_link + "'") + if article_link == "All": + c.execute("UPDATE rss_feed SET article_readed=1") + else: + c.execute("UPDATE rss_feed SET article_readed=1 WHERE article_link='" + article_link + "'") conn.commit() c.close() except Exception, e: pass + return self.index() index.exposed = True m.exposed = True f.exposed = True description.exposed = True all_articles.exposed = True + mark_as_read.exposed = True unread.exposed = True -- cgit