[GRASS-SVN] r36348 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Mar 12 19:11:15 EDT 2009


Author: martinl
Date: 2009-03-12 19:11:15 -0400 (Thu, 12 Mar 2009)
New Revision: 36348

Modified:
   grass/trunk/gui/wxpython/gui_modules/location_wizard.py
Log:
wxGUI/location wizard: some MS Windows-related issues
	(merge from relbr64, r36346)


Modified: grass/trunk/gui/wxpython/gui_modules/location_wizard.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/location_wizard.py	2009-03-12 23:08:51 UTC (rev 36347)
+++ grass/trunk/gui/wxpython/gui_modules/location_wizard.py	2009-03-12 23:11:15 UTC (rev 36348)
@@ -624,13 +624,17 @@
             return None
 
         data = []
+        str = str.lower()
         for i in range(len(self.sourceData)):
-            value = self.sourceData[i][index]
-            if str.lower() in value.lower():
-                data.append(self.sourceData[i])
-
+            try:
+                value = self.sourceData[i][index].lower()
+                if str in value:
+                    data.append(self.sourceData[i])
+            except UnicodeDecodeError:
+                # osgeo4w problem (should be fixed)
+                pass
         self.Populate(data)
-
+        
         if len(data) > 0:
             return data[0]
         else:
@@ -1251,7 +1255,7 @@
 
         # buttons
         self.bbrowse = self.MakeButton(_("Browse"))
-        self.bbcodes = self.MakeButton(_("Browse EPSG Codes"))
+        self.bbcodes = self.MakeButton(_("Reload EPSG Codes"))
 
         # search box
         self.searchb = wx.SearchCtrl(self, size=(200,-1),
@@ -1352,15 +1356,15 @@
             self.epsgdesc = self.epsgparams = ''
 
     def OnSearch(self, event):
-        str =  self.searchb.GetValue()
+        value =  self.searchb.GetValue()
         if self.epsglist.GetItemCount() == 0:
             event.Skip()
             return
         
         try:
-            self.epsgcode = self.epsglist.Search(index=1, str=str)[0]
+            self.epsgcode = self.epsglist.Search(index=1, str=value)[0]
             self.tcode.SetValue(str(self.epsgcode))
-        except:
+        except IndexError:
             self.epsgcode = None
             self.tcode.SetValue('')
 



More information about the grass-commit mailing list