From 4ac5825b32443c3408263f810f1678f9937894cc Mon Sep 17 00:00:00 2001 From: cedricbonhomme Date: Mon, 5 Jul 2010 12:27:54 +0200 Subject: Case-insensitive sorting. --- utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/utils.py b/utils.py index 1c699b34..ba0614c5 100755 --- a/utils.py +++ b/utils.py @@ -283,8 +283,11 @@ def load_feed(): articles, feeds = {}, OrderedDict() if list_of_feeds != []: sha1_hash = hashlib.sha1() - print sorted(list_of_feeds) - for feed in sorted(list_of_feeds): + # Case-insensitive sorting + tupleList = [(x[3].upper(), x) for x in list_of_feeds] + tupleList.sort(key=operator.itemgetter(0)) + + for feed in [x[1] for x in tupleList]: list_of_articles = c.execute(\ "SELECT * FROM articles WHERE feed_link='" + \ feed[2] + "'").fetchall() -- cgit