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

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Dec 13 11:45:12 EST 2008


Author: martinl
Date: 2008-12-13 11:45:12 -0500 (Sat, 13 Dec 2008)
New Revision: 34852

Modified:
   grass/trunk/gui/wxpython/gui_modules/dbm.py
Log:
wxGUI/dbm: fix decode error & insert new record dialog
	   (merge from devbr6, r34850)


Modified: grass/trunk/gui/wxpython/gui_modules/dbm.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/dbm.py	2008-12-13 16:44:33 UTC (rev 34851)
+++ grass/trunk/gui/wxpython/gui_modules/dbm.py	2008-12-13 16:45:12 UTC (rev 34852)
@@ -255,7 +255,11 @@
                     except ValueError:
                         self.itemDataMap[i].append('')
                 else:
-                    self.itemDataMap[i].append(unicodeValue(value))
+                    try:
+                        self.itemDataMap[i].append(unicodeValue(value))
+                    except UnicodeDecodeError:
+                        self.itemDataMap[i].append(_("Unable to decode value. "
+                                                     "Set encoding in GUI preferences ('Attributes')."))
                 
                 if keyId > -1 and keyId == j:
                     try:
@@ -1200,7 +1204,7 @@
                 values = dlg.GetValues() # values (need to be casted)
                 columnsString = ''
                 valuesString   = ''
-
+                
                 for i in range(len(values)):
                     if len(values[i]) == 0: # NULL
                         if columnName[i] == keyColumn:
@@ -3533,7 +3537,7 @@
         for labelId, valueId in self.widgets:
             column = self.FindWindowById(labelId).GetLabel().replace(':', '')
             if columns is None or column in columns:
-                value = self.FindWindowById(valueId).GetValue()
+                value = str(self.FindWindowById(valueId).GetValue())
                 valueList.append(value)
 
         # add key value



More information about the grass-commit mailing list