aboutsummaryrefslogtreecommitdiff
path: root/pyAggr3g470r.py
diff options
context:
space:
mode:
authorcedricbonhomme <devnull@localhost>2010-06-11 08:08:58 +0200
committercedricbonhomme <devnull@localhost>2010-06-11 08:08:58 +0200
commit09741d99fff3b1ef14749b0acf517994f9acf96f (patch)
treed7bef8a74577106256828b2b203980528a112135 /pyAggr3g470r.py
parentRelease 1.4. It is now possible to remove all articles of a given feed from t... (diff)
downloadnewspipe-09741d99fff3b1ef14749b0acf517994f9acf96f.tar.gz
newspipe-09741d99fff3b1ef14749b0acf517994f9acf96f.tar.bz2
newspipe-09741d99fff3b1ef14749b0acf517994f9acf96f.zip
Faster and safer code.
Diffstat (limited to 'pyAggr3g470r.py')
-rwxr-xr-xpyAggr3g470r.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py
index 787a4c69..3b758484 100755
--- a/pyAggr3g470r.py
+++ b/pyAggr3g470r.py
@@ -187,7 +187,7 @@ class Root:
if self.articles:
html += "<h1>Delete Feeds</h1>\n"
- html += """<form method=get action="/remove_feed/"><select name="url">\n"""
+ html += """<form method=get action="/remove_feed/"><select name="feed_id">\n"""
for feed_id in self.articles.keys():
html += """\t<option value="%s">%s</option>\n""" % \
(feed_id, self.feeds[feed_id][3].encode('utf-8'))
@@ -773,15 +773,19 @@ class Root:
add_feed.exposed = True
- def remove_feed(self, url):
+ def remove_feed(self, feed_id):
"""
- Remove a feed from the file fee.lst.
+ Remove a feed from the file feed.lst and from the SQLite base.
"""
html = htmlheader
html += htmlnav
html += """<div class="left inner">"""
- utils.remove_feed(self.feeds[url][4])
- html+= """<p>All articles from this feed are now removed from the base.</p><br />"""
+ if feed_id in self.feeds.keys():
+ utils.remove_feed(self.feeds[feed_id][4])
+ html+= """<p>All articles from the feed <i>%s</i> are now removed from the base.</p><br />""" % \
+ (self.feeds[feed_id][3].encode('utf-8'),)
+ else:
+ return self.error_page("This feed do not exists.")
html += """<a href="/management/">Back to the management page.</a><br />\n"""
html += "<hr />\n"
html += htmlfooter
bgstack15