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

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Dec 24 07:12:55 EST 2010


Author: martinl
Date: 2010-12-24 04:12:55 -0800 (Fri, 24 Dec 2010)
New Revision: 44709

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI: track error when getting interface description
(merge r44708 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2010-12-24 12:10:39 UTC (rev 44708)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2010-12-24 12:12:55 UTC (rev 44709)
@@ -1946,13 +1946,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