diff options
Diffstat (limited to 'pyAggr3g470r.py')
-rw-r--r-- | pyAggr3g470r.py | 12 |
1 files changed, 9 insertions, 3 deletions
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 += """<div class="right inner">\n""" html += """<a href="/f/">Fetch all feeds</a>\n<br />\n""" + html += """<a href="/mark_as_read/">Mark all articles as read</a>\n<br />\n""" html += """<a href="/m/">Management of feed</a>\n""" html += """<form method=get action="q/"><input type="text" name="v" value=""><input type="submit" value="search"></form>\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 |