[GRASS-SVN] r67335 - grass/branches/releasebranch_7_0/gui/wxpython/gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Dec 22 17:47:48 PST 2015


Author: annakrat
Date: 2015-12-22 17:47:48 -0800 (Tue, 22 Dec 2015)
New Revision: 67335

Modified:
   grass/branches/releasebranch_7_0/gui/wxpython/gui_core/query.py
Log:
wxGUI/query: convert everything to unicode to fix #2617 (merge from trunk, r67328)

Modified: grass/branches/releasebranch_7_0/gui/wxpython/gui_core/query.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gui_core/query.py	2015-12-23 01:44:43 UTC (rev 67334)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gui_core/query.py	2015-12-23 01:47:48 UTC (rev 67335)
@@ -17,6 +17,7 @@
 import wx
 
 from core.utils import _
+from core.gcmd import DecodeString
 from gui_core.treeview import TreeListView
 from core.treemodel import TreeModel, DictNode
 
@@ -173,6 +174,7 @@
 
 def QueryTreeBuilder(data, column):
     """Builds tree model from query results.
+    Convert to unicode.
 
     :param data: query results as a dictionary
     :param column: column name
@@ -181,12 +183,16 @@
     """
     def addNode(parent, data, model):
         for k, v in data.iteritems():
+            if isinstance(v, str):
+                k = DecodeString(k)
             if isinstance(v, dict):
                 node = model.AppendNode(parent=parent, label=k)
                 addNode(parent=node, data=v, model=model)
             else:
                 if not isinstance(v, basestring):
                     v = str(v)
+                elif isinstance(v, str):
+                    v = DecodeString(v)
                 node = model.AppendNode(parent=parent, label=k,
                                         data={column: v})
 



More information about the grass-commit mailing list