[GRASS-SVN] r62276 - grass/trunk/gui/wxpython/gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Oct 17 08:14:26 PDT 2014


Author: annakrat
Date: 2014-10-17 08:14:26 -0700 (Fri, 17 Oct 2014)
New Revision: 62276

Modified:
   grass/trunk/gui/wxpython/gui_core/query.py
Log:
wxGUI/query: convert to string only when necessary

Modified: grass/trunk/gui/wxpython/gui_core/query.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/query.py	2014-10-17 12:31:00 UTC (rev 62275)
+++ grass/trunk/gui/wxpython/gui_core/query.py	2014-10-17 15:14:26 UTC (rev 62276)
@@ -173,10 +173,10 @@
 
 def QueryTreeBuilder(data, column):
     """Builds tree model from query results.
-    
+
     :param data: query results as a dictionary
     :param column: column name
-    
+
     :return: tree model
     """
     def addNode(parent, data, model):
@@ -185,8 +185,10 @@
                 node = model.AppendNode(parent=parent, label=k)
                 addNode(parent=node, data=v, model=model)
             else:
+                if not isinstance(v, basestring):
+                    v = str(v)
                 node = model.AppendNode(parent=parent, label=k,
-                                        data={column: str(v)})
+                                        data={column: v})
 
     model = TreeModel(DictNode)
     for part in data:



More information about the grass-commit mailing list