From 7eaee7d8c2f06a8ed15c326e31f9724ee75e8040 Mon Sep 17 00:00:00 2001 From: cedricbonhomme Date: Sun, 31 Jan 2010 12:45:38 +0100 Subject: Sort articles by date for each feeds. --- pyAggr3g470r.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pyAggr3g470r.py') diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py index bc6f6340..34f6e226 100644 --- a/pyAggr3g470r.py +++ b/pyAggr3g470r.py @@ -81,10 +81,15 @@ class Root: dic = {} for article in list_of_articles: if article[2] not in dic: + dic[article[2]] = [(article[0], article[1], article[3], article[4])] else: dic[article[2]].append((article[0], article[1], article[3], article[4])) + # sort articles by date for each feeds + for feeds in dic.keys(): + dic[article[2]].sort(lambda x,y: cmp(y[0], x[0])) + return dic return {} -- cgit