diff options
author | cedricbonhomme <devnull@localhost> | 2010-02-07 11:27:09 +0100 |
---|---|---|
committer | cedricbonhomme <devnull@localhost> | 2010-02-07 11:27:09 +0100 |
commit | 67d0a8118e5fbf3a86d5652ecea9e2daedb6c12d (patch) | |
tree | 28bf6d5b4e86fdfd5447f90ee5337bb127e67157 | |
parent | Improvement. Tuple are remplaced by list of articles in order to update self.... (diff) | |
download | newspipe-67d0a8118e5fbf3a86d5652ecea9e2daedb6c12d.tar.gz newspipe-67d0a8118e5fbf3a86d5652ecea9e2daedb6c12d.tar.bz2 newspipe-67d0a8118e5fbf3a86d5652ecea9e2daedb6c12d.zip |
It is now possible to mark all articles as read.
-rw-r--r-- | pyAggr3g470r.py | 12 | ||||
-rw-r--r-- | var/feed.lst | 1 |
2 files changed, 10 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 diff --git a/var/feed.lst b/var/feed.lst index 02fc20c5..abe7f41a 100644 --- a/var/feed.lst +++ b/var/feed.lst @@ -21,3 +21,4 @@ http://kernelnewbies.org/RecentChanges?action=rss_rc&ddiffs=1&unique=1 http://www.kroah.com/log/index.rss http://www.lessentiel.lu/rss/news.tmpl http://www.jeffersonswheel.org/?feed=rss2 +http://www.laquadrature.net/en/rss.xml |