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

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Dec 24 07:10:39 EST 2010


Author: martinl
Date: 2010-12-24 04:10:39 -0800 (Fri, 24 Dec 2010)
New Revision: 44708

Modified:
   grass/trunk/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI: track error when getting interface description

Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py	2010-12-24 01:14:00 UTC (rev 44707)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py	2010-12-24 12:10:39 UTC (rev 44708)
@@ -2120,13 +2120,15 @@
 
     @param cmd command (name of GRASS module)
     """
-    nuldev = file(os.devnull, 'w+')
     try:
-        cmdout = grass.Popen([cmd, '--interface-description'], stdout = grass.PIPE,
-                             stderr = nuldev).communicate()[0]
-    except OSError:
-        raise gcmd.GException, _("Unable to fetch interface description for command '%s'.") % cmd
-    nuldev.close()
+        cmdout, cmderr = grass.Popen([cmd, '--interface-description'], stdout = grass.PIPE,
+                                     stderr = grass.PIPE).communicate()
+    except OSError, e:
+        raise gcmd.GException, _("Unable to fetch interface description for command '%s'. "
+                                 "Details: %s") % (cmd, repr(e))
+    if cmderr:
+        raise gcmd.GException, _("Unable to fetch interface description for command '%s'. "
+                                 "Details: %s") % (cmd, cmderr)
     
     return cmdout.replace('grass-interface.dtd', os.path.join(globalvar.ETCDIR, 'grass-interface.dtd'))
     



More information about the grass-commit mailing list