[GRASS-SVN] r34652 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Dec 1 07:03:48 EST 2008


Author: martinl
Date: 2008-12-01 07:03:48 -0500 (Mon, 01 Dec 2008)
New Revision: 34652

Modified:
   grass/trunk/gui/wxpython/gui_modules/dbm.py
Log:
wxGUI/atm: don't crash on db.tables (trac #381)
	   (merge from devbr6, r34651)


Modified: grass/trunk/gui/wxpython/gui_modules/dbm.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/dbm.py	2008-12-01 12:00:54 UTC (rev 34651)
+++ grass/trunk/gui/wxpython/gui_modules/dbm.py	2008-12-01 12:03:48 UTC (rev 34652)
@@ -2460,8 +2460,16 @@
         cmdTable = gcmd.Command(['db.tables',
                                  '-p', '--q',
                                  'driver=%s' % driver,
-                                 'database=%s' % database])
+                                 'database=%s' % database], rerr=None)
 
+        if cmdTable.returncode != 0:
+            wx.MessageBox(parent=self,
+                          message=_("Unable to get list of tables.\n"
+                                    "Please use db.connect to set database parameters."),
+                          caption=_("Error"), style=wx.OK | wx.ICON_ERROR | wx.CENTRE)
+
+            return tables
+        
         for table in cmdTable.ReadStdOutput():
             tables.append(table)
 



More information about the grass-commit mailing list