diff options
author | cedricbonhomme <devnull@localhost> | 2011-06-19 00:10:54 +0200 |
---|---|---|
committer | cedricbonhomme <devnull@localhost> | 2011-06-19 00:10:54 +0200 |
commit | f34d5bf48f08c75f7dc4476d197735f41219889b (patch) | |
tree | 545a94b804657db4c22b09b21d2e5e6ed3363193 /pyAggr3g470r.py | |
parent | New link to the feed page. (diff) | |
download | newspipe-f34d5bf48f08c75f7dc4476d197735f41219889b.tar.gz newspipe-f34d5bf48f08c75f7dc4476d197735f41219889b.tar.bz2 newspipe-f34d5bf48f08c75f7dc4476d197735f41219889b.zip |
Added a new function which enables to change the URL of a feed (this updates all the data base).
Diffstat (limited to 'pyAggr3g470r.py')
-rwxr-xr-x | pyAggr3g470r.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py index 51915d0a..a5ed2d4a 100755 --- a/pyAggr3g470r.py +++ b/pyAggr3g470r.py @@ -635,6 +635,11 @@ class Root: html += article.article_date + " - " + \ """<a class="tooltip" href="/article/%s:%s" rel="noreferrer" target="_blank">%s<span class="classic">%s</span></a><br />\n""" % \ (feed.feed_id, article.article_id, article.article_title[:150], description) + + + html += """\n<br /><br />\n<form method=post action="/change_feed_url/"><input type="url" name="new_feed_url" value="" placeholder="Enter a new URL for this feed." maxlength=2048 autocomplete="on" size="50" /><input type="hidden" name="old_feed_url" value="%s" /></form>\n""" % \ + (feed.feed_link,) + dic = {} dic[feed.feed_id] = self.feeds[feed.feed_id] top_words = utils.top_words(dic, n=50, size=int(word_size)) @@ -648,9 +653,6 @@ class Root: utils.tag_cloud(top_words) + '</div>' html += "<br />" - #html += """<form method=get action="/change_feed_url/"><input type="url" name="querrystring" placeholder="New URL for this feed" maxlength=2048 autocomplete="off">\n<input type="submit" value="OK"></form>\n""" % (feed.feed_id,) - - html += "<hr />" html += htmlfooter return html @@ -1096,14 +1098,16 @@ class Root: remove_feed.exposed = True - def change_feed_url(self, querrystring): + def change_feed_url(self, new_feed_url, old_feed_url): """ Enables to change the URL of a feed already present in the database. """ html = htmlheader() html += htmlnav html += """<div class="left inner">""" - + print cherrypy.request.params + utils.change_feed_url(old_feed_url, new_feed_url) + html += "<p>The URL of the feed has been changed.</p>" html += "<hr />\n" html += htmlfooter return html |