[GRASS-SVN] r67328 - grass/trunk/gui/wxpython/gui_core
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Dec 22 07:44:24 PST 2015
Author: annakrat
Date: 2015-12-22 07:44:24 -0800 (Tue, 22 Dec 2015)
New Revision: 67328
Modified:
grass/trunk/gui/wxpython/gui_core/query.py
Log:
wxGUI/query: convert everything to unicode to fix #2617
Modified: grass/trunk/gui/wxpython/gui_core/query.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/query.py 2015-12-22 15:05:48 UTC (rev 67327)
+++ grass/trunk/gui/wxpython/gui_core/query.py 2015-12-22 15:44:24 UTC (rev 67328)
@@ -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