From 1ba0bcfb0bb085c13e5b2ac791aed56a713249a3 Mon Sep 17 00:00:00 2001 From: cedricbonhomme Date: Sat, 10 Mar 2012 08:38:04 +0100 Subject: Better code of the management page. --- pyAggr3g470r.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py index ae7af2d4..e9edd6f0 100755 --- a/pyAggr3g470r.py +++ b/pyAggr3g470r.py @@ -245,7 +245,11 @@ class Root: and display some statistics. """ feeds = self.mongo.get_all_collections() - + nb_mail_notifications = self.mongo.nb_mail_notifications() + nb_favorites = self.mongo.nb_favorites() + nb_articles = self.mongo.nb_articles() + nb_unread_articles = self.mongo.nb_unread_articles() + html = htmlheader() html += htmlnav html += """
\n""" @@ -262,16 +266,16 @@ class Root: html += """\n""" html += """

Active e-mail notifications: %s

\n""" % \ - (self.mongo.nb_mail_notifications(),) + (nb_mail_notifications,) html += """

You like %s article(s).

\n""" % \ - (self.mongo.nb_favorites(), ) + (nb_favorites, ) html += "
\n" # Informations about the data base of articles html += """

%s article(s) are loaded from the database with %s unread article(s).
\n""" % \ - (self.mongo.nb_articles(), self.mongo.nb_unread_articles()) + (nb_articles, nb_unread_articles) #html += """Database: %s.\n
Size: %s bytes.
\n""" % \ #(os.path.abspath(utils.sqlite_base), os.path.getsize(utils.sqlite_base)) html += 'Advanced statistics.

\n' -- cgit