Make the dictionary sorting a bit more sensible

This commit is contained in:
Sayamindu Dasgupta 2010-02-09 17:43:18 +05:30
parent 4552050136
commit 1b600b147d

View File

@ -138,6 +138,7 @@ def get_locale_path(bundle_id):
# Set lowest priority # Set lowest priority
candidate_dirs[candidate_dir] = -1 candidate_dirs[candidate_dir] = -1
# Fancy way to sort the dictionary by value sorted_dict = sorted(candidate_dirs.iteritems(), key=lambda (k, v): \
return sorted(candidate_dirs.iteritems(), key=lambda (k, v): (v, k), \ (v, k), reverse=True)
reverse=True)[0][0]
return sorted_dict[0][0]