[GRASS-SVN] r72560 - grass/branches/releasebranch_7_4/gui/wxpython/dbmgr

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Mar 25 03:44:39 PDT 2018


Author: martinl
Date: 2018-03-25 03:44:39 -0700 (Sun, 25 Mar 2018)
New Revision: 72560

Modified:
   grass/branches/releasebranch_7_4/gui/wxpython/dbmgr/sqlbuilder.py
Log:
wxGUI/dbmgr: improve get values speed

Modified: grass/branches/releasebranch_7_4/gui/wxpython/dbmgr/sqlbuilder.py
===================================================================
--- grass/branches/releasebranch_7_4/gui/wxpython/dbmgr/sqlbuilder.py	2018-03-24 19:57:07 UTC (rev 72559)
+++ grass/branches/releasebranch_7_4/gui/wxpython/dbmgr/sqlbuilder.py	2018-03-25 10:44:39 UTC (rev 72560)
@@ -369,16 +369,17 @@
             self.dbInfo.GetTable(self.layer))[column]
 
         i = 0
+        items = []
         for item in sorted(set(map(lambda x: desc['ctype'](x[0]), data))):
             if justsample and i > 255:
                 break
 
             if desc['type'] != 'character':
-                item = str(item)
+                items.append(str(item))
             else:
-                item = GetUnicodeValue(item)
-            self.list_values.Append(item)
+                items.append(GetUnicodeValue(item))
             i += 1
+        self.list_values.AppendItems(items)
 
     def OnSampleValues(self, event):
         """Get sample values"""



More information about the grass-commit mailing list