diff options
author | cedricbonhomme <devnull@localhost> | 2011-04-15 19:42:35 +0200 |
---|---|---|
committer | cedricbonhomme <devnull@localhost> | 2011-04-15 19:42:35 +0200 |
commit | 657b2336256428e6d55cc8a3fd5713e51e8dc35b (patch) | |
tree | ad7adb970a6138fd6c6225d48a4ece5dcbd34223 /pyAggr3g470r.py | |
parent | Added picture for Diaspora. (diff) | |
download | newspipe-657b2336256428e6d55cc8a3fd5713e51e8dc35b.tar.gz newspipe-657b2336256428e6d55cc8a3fd5713e51e8dc35b.tar.bz2 newspipe-657b2336256428e6d55cc8a3fd5713e51e8dc35b.zip |
Added a new form in the management page in order to set the number of articles load by feed to be loaded.
Diffstat (limited to 'pyAggr3g470r.py')
-rwxr-xr-x | pyAggr3g470r.py | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py index eb7accce..f84a82d0 100755 --- a/pyAggr3g470r.py +++ b/pyAggr3g470r.py @@ -242,7 +242,7 @@ class Root: return html + "</div>" - def management(self, word_size=6): + def management(self, word_size=6, max_nb_articles=5): """ Management page. Allows adding and deleting feeds. Export functions of the SQLite data base @@ -277,9 +277,21 @@ class Root: html += """Database: %s.\n<br />Size: %s bytes.</p>\n""" % \ (os.path.abspath(utils.sqlite_base), os.path.getsize(utils.sqlite_base)) - # Export functions 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""" + + + html += '<form method=get action="/set_max_articles/">' + html += "For each feed only load the " + html += """<input type="number" name="max_nb_articles" value="%s" min="5" max="5000" step="1" size="2">\n""" % (max_nb_articles) + html += " last articles." + if utils.MAX_NB_ARTICLES == -1: + html += "<br />All articles are currently loaded." + else: + html += "<br />For each feed only " + str(utils.MAX_NB_ARTICLES) + " articles are currently loaded." + html += "</form>" + + # Export functions html += "<h1>Export articles</h1>\n\n" html += """<form method=get action="/export/"><select name="export_method">\n""" html += """\t<option value="export_HTML" selected='selected'>HTML</option>\n""" @@ -1071,6 +1083,16 @@ class Root: change_feed_url.exposed = True + def set_max_articles(self, max_nb_articles=0): + """ + """ + utils.MAX_NB_ARTICLES = int(max_nb_articles) + self.update() + return self.management() + + set_max_articles.exposed = True + + def delete_article(self, param): """ Delete an article. |