[GRASS-SVN] r35185 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jan 4 01:19:00 EST 2009


Author: cmbarton
Date: 2009-01-04 01:18:59 -0500 (Sun, 04 Jan 2009)
New Revision: 35185

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py
Log:
Fix bug in TableSelect.InsertTables that caused v.db.connect to crash. Also fixed bogus error message when selecting items.

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py	2009-01-03 17:28:53 UTC (rev 35184)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py	2009-01-04 06:18:59 UTC (rev 35185)
@@ -125,8 +125,11 @@
             if not root:
                 return
             item = self.FindItem(root, self.value[0])
-            self.seltree.EnsureVisible(item)
-            self.seltree.SelectItem(item)
+            try:
+                self.seltree.SelectItem(item)
+                self.seltree.EnsureVisible(item)
+            except:
+                pass
             
     def SetStringValue(self, value):
         # this assumes that item strings are unique...
@@ -483,18 +486,16 @@
     def InsertTables(self, driver=None, database=None):
         """Insert attribute tables into combobox"""
         items = []
-        ret = gcmd.RunCommand('db.tables',
-                              flag = 'p',
-                              parent = self,
-                              driver = driver,
-                              database = database)
+        tableCmd = None
+        ret = grass.read_command('db.tables',
+                                  flags = 'p',
+                                  driver = driver,
+                                  database = database)
         
-        if ret != 0:
+        if ret == None:
             tableCmd = None
-        
-        if tableCmd and \
-                tableCmd.returncode == 0:
-            for table in tableCmd.ReadStdOutput():
+        else:
+            for table in ret.split('\n'):
                 items.append(table)
             
         self.SetItems(items)



More information about the grass-commit mailing list