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

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Dec 1 07:00:54 EST 2008


Author: martinl
Date: 2008-12-01 07:00:54 -0500 (Mon, 01 Dec 2008)
New Revision: 34651

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/dbm.py
Log:
wxGUI/atm: don't crash on db.tables (trac #381) 


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/dbm.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/dbm.py	2008-12-01 07:28:34 UTC (rev 34650)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/dbm.py	2008-12-01 12:00:54 UTC (rev 34651)
@@ -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