aboutsummaryrefslogtreecommitdiff
path: root/pyAggr3g470r.py
diff options
context:
space:
mode:
authorcedricbonhomme <devnull@localhost>2010-02-07 11:27:09 +0100
committercedricbonhomme <devnull@localhost>2010-02-07 11:27:09 +0100
commit67d0a8118e5fbf3a86d5652ecea9e2daedb6c12d (patch)
tree28bf6d5b4e86fdfd5447f90ee5337bb127e67157 /pyAggr3g470r.py
parentImprovement. Tuple are remplaced by list of articles in order to update self.... (diff)
downloadnewspipe-67d0a8118e5fbf3a86d5652ecea9e2daedb6c12d.tar.gz
newspipe-67d0a8118e5fbf3a86d5652ecea9e2daedb6c12d.tar.bz2
newspipe-67d0a8118e5fbf3a86d5652ecea9e2daedb6c12d.zip
It is now possible to mark all articles as read.
Diffstat (limited to 'pyAggr3g470r.py')
-rw-r--r--pyAggr3g470r.py12
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
bgstack15