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

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jan 4 13:32:41 EST 2009


Author: cmbarton
Date: 2009-01-04 13:32:41 -0500 (Sun, 04 Jan 2009)
New Revision: 35208

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py
Log:
Updating InsertTables method to match releasebranch and trunk code.

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py	2009-01-04 17:51:43 UTC (rev 35207)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py	2009-01-04 18:32:41 UTC (rev 35208)
@@ -486,18 +486,21 @@
     def InsertTables(self, driver=None, database=None):
         """Insert attribute tables into combobox"""
         items = []
-        tableCmd = None
-        ret = gcmd.RunCommand('db.tables',
-                              parent = self,
-                              read = True,
-                              flags = 'p',
-                              driver = driver,
-                              database = database)
+        cmd = ['db.tables',
+               '-p']
+        if driver:
+            cmd.append('driver=%s' % driver)
+        if database:
+            cmd.append('database=%s' % database)
         
-        if ret == None:
+        try:
+            tableCmd = gcmd.Command(cmd)
+        except gcmd.CmdError:
             tableCmd = None
-        else:
-            for table in ret.split('\n'):
+        
+        if tableCmd and \
+                tableCmd.returncode == 0:
+            for table in tableCmd.ReadStdOutput():
                 items.append(table)
             
         self.SetItems(items)



More information about the grass-commit mailing list