[GRASS-SVN] r62563 - in grass/branches/releasebranch_7_0: . gui/wxpython/vnet

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Nov 2 15:07:37 PST 2014


Author: annakrat
Date: 2014-11-02 15:07:37 -0800 (Sun, 02 Nov 2014)
New Revision: 62563

Modified:
   grass/branches/releasebranch_7_0/
   grass/branches/releasebranch_7_0/gui/wxpython/vnet/widgets.py
Log:
wxGUI/vnet: fix encoding problem with French locale #2145, merge from trunk, r62562


Property changes on: grass/branches/releasebranch_7_0
___________________________________________________________________
Modified: svn:mergeinfo
   - /grass/trunk:62179-62180,62182,62403,62466,62487,62491,62494,62506,62508-62509,62515,62518-62519,62521,62526,62533,62539,62541,62555
   + /grass/trunk:62179-62180,62182,62403,62466,62487,62491,62494,62506,62508-62509,62515,62518-62519,62521,62526,62533,62539,62541,62555,62562

Modified: grass/branches/releasebranch_7_0/gui/wxpython/vnet/widgets.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/vnet/widgets.py	2014-11-02 23:05:50 UTC (rev 62562)
+++ grass/branches/releasebranch_7_0/gui/wxpython/vnet/widgets.py	2014-11-02 23:07:37 UTC (rev 62563)
@@ -227,7 +227,9 @@
             self.selIdxs[key][colNum] = -1
 
         self.itemDataMap[key][colNum] = cellVal
-        self.SetStringItem(index, colNum, str(cellVal))
+        if not isinstance(cellVal, basestring):
+            cellVal = str(cellVal)
+        self.SetStringItem(index, colNum, cellVal)
 
     def EditCellKey(self, key, colName, cellData):
         """!Changes value in list using index (changes during sorting)"""
@@ -245,7 +247,9 @@
         index = self._findIndex(key)
 
         if index != -1:
-            self.SetStringItem(index, colNum, str(cellVal))
+            if not isinstance(cellVal, basestring):
+                cellVal = str(cellVal)
+            self.SetStringItem(index, colNum, cellVal)
 
     def _findIndex(self, key):
         """!Find index for key"""
@@ -375,7 +379,10 @@
                 i = 0
                 for editedCell in editedData:
                     if editedCell[1] != data[i][1]:
-                        self.SetStringItem(index, editedCell[0], str(editedCell[1]))
+                        value = editedCell[1]
+                        if not isinstance(editedCell[1], basestring):
+                            value = str(editedCell[1])
+                        self.SetStringItem(index, editedCell[0], value)
                         self.itemDataMap[key][editedCell[0]] = editedCell[1]
                         changed = True
                     i += 1 
@@ -562,7 +569,10 @@
                 else:
                     self.fields.append(wx.TextCtrl(parent=panel, id=wx.ID_ANY, 
                                                    size=(150, -1)))
-                    self.fields[iField].SetValue(str(cell[1]))
+                    value = cell[1]
+                    if not isinstance(cell[1], basestring):
+                        value = str(cell[1])
+                    self.fields[iField].SetValue(value)
 
             label = wx.StaticText(parent = panel, id=wx.ID_ANY,
                                   label = _(parent.GetColumn(cell[0]).GetText()) + ":") # name of column)



More information about the grass-commit mailing list