aboutsummaryrefslogtreecommitdiff
path: root/pyAggr3g470r.py
diff options
context:
space:
mode:
authorcedricbonhomme <devnull@localhost>2011-06-07 12:40:38 +0200
committercedricbonhomme <devnull@localhost>2011-06-07 12:40:38 +0200
commit719a1c49967516ccf7b27c28a2f15e86d7eb1448 (patch)
treeadf0d0839f9bee07dcfdeca51b643612083e08f0 /pyAggr3g470r.py
parentBugfix: IndexError: list index out of range when a feed is empty. (diff)
downloadnewspipe-719a1c49967516ccf7b27c28a2f15e86d7eb1448.tar.gz
newspipe-719a1c49967516ccf7b27c28a2f15e86d7eb1448.tar.bz2
newspipe-719a1c49967516ccf7b27c28a2f15e86d7eb1448.zip
Minor Bugfix. Age of the last article.
Diffstat (limited to 'pyAggr3g470r.py')
-rwxr-xr-xpyAggr3g470r.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py
index 737b109e..2b47ec87 100755
--- a/pyAggr3g470r.py
+++ b/pyAggr3g470r.py
@@ -570,7 +570,7 @@ class Root:
first_article = utils.string_to_datetime(feed.articles.values()[-1].article_date)
delta = last_article - first_article
delta_today = datetime.datetime.fromordinal(datetime.date.today().toordinal()) - last_article
- html += "<p>The last article was posted " + str(abs(delta_today.days)) + " day(s) ago.</p>"
+ html += "<p>The last article was posted " + str(abs(delta_today.days) - 1) + " day(s) ago.</p>"
if delta.days > 0:
html += """<p>Daily average: %s,""" % (str(round(float(feed.nb_articles)/abs(delta.days), 2)),)
html += """ between the %s and the %s.</p>\n""" % \
bgstack15