[GRASS-SVN] r29544 - grass/trunk/gui/wxpython

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Dec 30 19:21:23 EST 2007


Author: cmbarton
Date: 2007-12-30 19:21:23 -0500 (Sun, 30 Dec 2007)
New Revision: 29544

Modified:
   grass/trunk/gui/wxpython/gis_set.py
Log:
Forced alphabetic sorting of location and mapset lists (case insensitive) in startup screen.

Modified: grass/trunk/gui/wxpython/gis_set.py
===================================================================
--- grass/trunk/gui/wxpython/gis_set.py	2007-12-30 21:45:59 UTC (rev 29543)
+++ grass/trunk/gui/wxpython/gis_set.py	2007-12-31 00:21:23 UTC (rev 29544)
@@ -502,6 +502,8 @@
                     self.listOfLocations.append(os.path.basename(location))
             except:
                 pass
+            
+        self.listOfLocations.sort(cmp=lambda x,y: cmp(x.lower(), y.lower()))
 
         self.lblocations.Clear()
         self.lblocations.InsertItems(self.listOfLocations, 0)
@@ -512,10 +514,12 @@
         """Update list of mapsets"""
         self.listOfMapsets = []
 
-        self.listOfMapsets.append('PERMANENT')
         for mapset in glob.glob(os.path.join(self.gisdbase, location, "*")):
             if os.path.isdir(mapset) and os.path.basename(mapset) != 'PERMANENT':
                 self.listOfMapsets.append(os.path.basename(mapset))
+        
+        self.listOfMapsets.sort(cmp=lambda x,y: cmp(x.lower(), y.lower()))
+        self.listOfMapsets.insert(0,'PERMANENT')
  
         self.lbmapsets.Clear()
         self.lbmapsets.InsertItems(self.listOfMapsets,0)



More information about the grass-commit mailing list