[GRASS-SVN] r35212 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Jan 4 14:10:17 EST 2009
Author: martinl
Date: 2009-01-04 14:10:17 -0500 (Sun, 04 Jan 2009)
New Revision: 35212
Modified:
grass/trunk/gui/wxpython/gui_modules/gselect.py
Log:
wxGUI: fix InsertTables
Modified: grass/trunk/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gselect.py 2009-01-04 18:44:06 UTC (rev 35211)
+++ grass/trunk/gui/wxpython/gui_modules/gselect.py 2009-01-04 19:10:17 UTC (rev 35212)
@@ -474,18 +474,21 @@
def InsertTables(self, driver=None, database=None):
"""Insert attribute tables into combobox"""
items = []
+
+ if not driver or not database:
+ connect = grass.db_connection()
+
+ driver = connect['driver']
+ database = connect['database']
+
ret = gcmd.RunCommand('db.tables',
- flag = 'p',
- parent = self,
+ flags = 'p',
+ read = True,
driver = driver,
database = database)
- if ret != 0:
- tableCmd = None
-
- if tableCmd and \
- tableCmd.returncode == 0:
- for table in tableCmd.ReadStdOutput():
+ if ret:
+ for table in ret.split('\n'):
if len(table) > 0:
items.append(table)
More information about the grass-commit
mailing list