aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcedricbonhomme <devnull@localhost>2012-03-02 08:29:33 +0100
committercedricbonhomme <devnull@localhost>2012-03-02 08:29:33 +0100
commit07a7a1dfeb91e20548bb0e95fd87687d1fbbbc13 (patch)
tree7e36f54be3318ba2ec8358a907c7bbeac0c220db
parentAdded new test feed. (diff)
downloadnewspipe-07a7a1dfeb91e20548bb0e95fd87687d1fbbbc13.tar.gz
newspipe-07a7a1dfeb91e20548bb0e95fd87687d1fbbbc13.tar.bz2
newspipe-07a7a1dfeb91e20548bb0e95fd87687d1fbbbc13.zip
New statistics page. Lighter management page.
-rwxr-xr-xpyAggr3g470r.py26
1 files changed, 20 insertions, 6 deletions
diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py
index b7f5c9e6..01064228 100755
--- a/pyAggr3g470r.py
+++ b/pyAggr3g470r.py
@@ -228,7 +228,7 @@ class Root:
return html + "</div>"
- def management(self, word_size=6, max_nb_articles=5):
+ def management(self, max_nb_articles=5):
"""
Management page.
Allows adding and deleting feeds. Export functions of the SQLite data base
@@ -258,10 +258,11 @@ class Root:
# Informations about the data base of articles
html += """<p>%s article(s) are loaded from the database with
- <a href="/unread/">%s unread article(s)</a>.<br />""" % \
+ <a href="/unread/">%s unread article(s)</a>.<br />\n""" % \
(self.nb_articles, self.nb_unread_articles)
- html += """Database: %s.\n<br />Size: %s bytes.</p>\n""" % \
+ html += """Database: %s.\n<br />Size: %s bytes.<br />\n""" % \
(os.path.abspath(utils.sqlite_base), os.path.getsize(utils.sqlite_base))
+ html += '<a href="/statistics/">Advanced statistics.</a></p>\n'
html += """<form method=get action="/fetch/">\n<input type="submit" value="Fetch all feeds"></form>\n"""
html += """<form method=get action="/drop_base">\n<input type="submit" value="Delete all articles"></form>\n"""
@@ -286,7 +287,20 @@ class Root:
html += """\t<option value="export_pdf">PDF</option>\n"""
html += """\t<option value="export_txt">Text</option>\n"""
html += """</select>\n\t<input type="submit" value="Export">\n</form>\n"""
- html += "<hr />\n\n"
+ html += "<hr />"
+ html += htmlfooter
+ return html
+
+ management.exposed = True
+
+
+ def statistics(self, word_size=6):
+ """
+ More advanced statistics.
+ """
+ html = htmlheader()
+ html += htmlnav
+ html += """<div class="left inner">\n"""
# Some statistics (most frequent word)
if self.feeds:
@@ -301,12 +315,12 @@ class Root:
html += '<div style="width: 35%; overflow:hidden; text-align: justify">' + \
utils.tag_cloud(self.top_words) + '</div>'
html += "<hr />\n"
+
html += htmlfooter
return html
- management.exposed = True
-
+ statistics.exposed = True
def q(self, querystring=None):
"""
Simply search for the string 'querystring'
bgstack15