The following commit has been merged in the master branch:
commit 80bc149397c6c584a1c750584c71090c46c3d06a
Author: Michal Čihař <[email protected]>
Date:   Thu Oct 8 17:35:47 2009 +0200

    Sort function for languages.
    
    We want english to be first all the time.

diff --git a/manpages/views.py b/manpages/views.py
index 68c25d5..ac54051 100644
--- a/manpages/views.py
+++ b/manpages/views.py
@@ -12,6 +12,13 @@ langnames = {
     'en': 'English',
 }
 
+def langcmp(a, b):
+    if a == 'en':
+        return -1
+    if b == 'en':
+        return 1
+    return cmp(a, b)
+
 # Create your views here.
 
 def show_page(request, page, lang = 'en'):
@@ -26,7 +33,7 @@ def show_page(request, page, lang = 'en'):
 
 def list_langs():
     ret = os.listdir('%s/docs/man' % settings.HTML_ROOT)
-    ret.sort()
+    ret.sort(cmp = langcmp)
     return ret
 
 def list_pages(lang = 'en'):

-- 
UNNAMED PROJECT

_______________________________________________
Wammu-svn mailing list
[email protected]
https://lists.cihar.com/cgi-bin/mailman/listinfo/wammu-svn

Reply via email to