From 1daef34f3ca3bac644fcb4d5ef15055f48d355b6 Mon Sep 17 00:00:00 2001 From: Holger Schurig Date: Wed, 14 Apr 2010 16:25:22 +0200 Subject: [PATCH] hierarchy: correctly display last recently changed pages Don't truncate prematurely, a quite recent page can very well be at position 15 and advance to position 1 due to sorting. --- plugins/hierarchy.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/hierarchy.py b/plugins/hierarchy.py index 8c65003..1b82782 100644 --- a/plugins/hierarchy.py +++ b/plugins/hierarchy.py @@ -179,8 +179,7 @@ def get_recently(page=None, max_items=10): res.append( (page, get_link_from(orig_page, page)) ) if _childs.has_key(page.linktitle): for c in _childs[page.linktitle]: - if len(res) < max_items: - addPage(res, get_file_for(c[1])) + addPage(res, get_file_for(c[1])) addPage(res, orig_page) res.sort(cmp = lambda x,y: cmp(y[0].mtime, x[0].mtime)) - return res + return res[:max_items] -- 2.39.2