From 864d8a49934894fe59ed89517063f1c05d6fb0fc Mon Sep 17 00:00:00 2001 From: cedricbonhomme Date: Tue, 1 May 2012 18:18:28 +0200 Subject: It is now possible to update information about a feed with the MongoDG database. --- source/pyAggr3g470r.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'source/pyAggr3g470r.py') diff --git a/source/pyAggr3g470r.py b/source/pyAggr3g470r.py index f00fe795..48103319 100755 --- a/source/pyAggr3g470r.py +++ b/source/pyAggr3g470r.py @@ -656,18 +656,18 @@ class Root: html += '\n\n
' + \ '' + \ - """
\n""" % \ - (feed["feed_link"],) + """\n""" % \ + (feed["feed_id"],) html += '\n\n
' + \ '' + \ - """
\n""" % \ - (feed["feed_link"],) + """\n""" % \ + (feed["feed_id"], feed["feed_link"]) html += '\n\n
' + \ - '' + \ - """
\n""" % \ - (feed["feed_link"],) + """\n""" % \ + (feed["feed_id"],) dic = {} top_words = utils.top_words(articles = self.mongo.get_articles_from_collection(feed_id), n=50, size=int(word_size)) @@ -1101,13 +1101,14 @@ class Root: remove_feed.exposed = True - def change_feed_url(self, new_feed_url, old_feed_url): + def change_feed_url(self, feed_id, old_feed_url, new_feed_url): """ Enables to change the URL of a feed already present in the database. """ html = htmlheader() html += htmlnav html += """
""" + self.mongo.update_feed(feed_id, {"feed_link":new_feed_url}) utils.change_feed_url(old_feed_url, new_feed_url) html += "

The URL of the feed has been changed.

" html += "
\n" @@ -1116,14 +1117,14 @@ class Root: change_feed_url.exposed = True - def change_feed_name(self, feed_url, new_feed_name): + def change_feed_name(self, feed_id, new_feed_name): """ Enables to change the name of a feed. """ html = htmlheader() html += htmlnav html += """
""" - utils.change_feed_name(feed_url, new_feed_name) + self.mongo.update_feed(feed_id, {"feed_title":new_feed_name}) html += "

The name of the feed has been changed.

" html += "
\n" html += htmlfooter @@ -1131,14 +1132,14 @@ class Root: change_feed_name.exposed = True - def change_feed_logo(self, feed_url, new_feed_logo): + def change_feed_logo(self, feed_id, new_feed_logo): """ Enables to change the name of a feed. """ html = htmlheader() html += htmlnav html += """
""" - utils.change_feed_logo(feed_url, new_feed_logo) + self.mongo.update_feed(feed_id, {"feed_image":new_feed_logo}) html += "

The logo of the feed has been changed.

" html += "
\n" html += htmlfooter -- cgit