aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcedricbonhomme <devnull@localhost>2010-07-05 12:27:54 +0200
committercedricbonhomme <devnull@localhost>2010-07-05 12:27:54 +0200
commit4ac5825b32443c3408263f810f1678f9937894cc (patch)
treed120d218d7382cf30c3b2770ed53eb49b094a115
parentRelease 1.5. (+ a minor bug fix.) (diff)
downloadnewspipe-4ac5825b32443c3408263f810f1678f9937894cc.tar.gz
newspipe-4ac5825b32443c3408263f810f1678f9937894cc.tar.bz2
newspipe-4ac5825b32443c3408263f810f1678f9937894cc.zip
Case-insensitive sorting.
-rwxr-xr-xutils.py7
1 files 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()
bgstack15