From 224842cb7bc801e6b192061ae44ada2b901d7254 Mon Sep 17 00:00:00 2001 From: cedricbonhomme Date: Mon, 22 Feb 2010 12:28:19 +0100 Subject: Added a new page for the management of feeds and database. --- pyAggr3g470r.py | 45 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 8 deletions(-) (limited to 'pyAggr3g470r.py') diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py index 4a94def4..4ff01023 100644 --- a/pyAggr3g470r.py +++ b/pyAggr3g470r.py @@ -52,9 +52,9 @@ class Root: html = htmlheader html += htmlnav html += """
\n""" - html += """Fetch all feeds\n
\n""" + html += """Fetch all feeds\n
\n""" html += """Mark all articles as read\n
\n""" - html += """Management of feed\n""" + html += """Management of feed\n""" html += """
\n""" html += "
\n" @@ -106,10 +106,39 @@ class Root: html += htmlfooter return html - def m(self): + def management(self): """ """ - return "Hello world !" + self.dic, self.dic_info = self.load_feed() + html = htmlheader + html += htmlnav + html += """
\n""" + html += "

Add Feeds

\n" + html += """
\n
\n""" + + html += "

Delete Feeds

\n" + html += """
\n""" + + html += "
\n" + + html += """The database contains a total of %s articles with + %s unread articles.

""" % \ + (sum([feed[0] for feed in self.dic_info.values()]), + sum([feed[1] for feed in self.dic_info.values()])) + + html += """
\n
\n""" + html += """
\n
\n""" + + html += "
\n" + html += htmlfooter + return html def q(self, v=None): """ @@ -145,7 +174,7 @@ class Root: html += htmlfooter return html - def f(self): + def fetch(self): """ Fetch all feeds """ @@ -252,7 +281,7 @@ class Root: # dic[feed_id] = (article_id, article_date, article_title, # article_link, article_description, feed_title, # feed_link, article_readed) - # dic_info[feed_id] = (nb_article, nb_article_readed) + # dic_info[feed_id] = (nb_article, nb_article_unreaded) dic, dic_info = {}, {} if list_of_articles is not None: for article in list_of_articles: @@ -314,8 +343,8 @@ class Root: return self.all_articles(identifiant) index.exposed = True - m.exposed = True - f.exposed = True + management.exposed = True + fetch.exposed = True q.exposed = True description.exposed = True all_articles.exposed = True -- cgit