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

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Aug 26 04:27:17 EDT 2010


Author: martinl
Date: 2010-08-26 08:27:17 +0000 (Thu, 26 Aug 2010)
New Revision: 43274

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
Log:
attempt to fix #1137
(merge r43266 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2010-08-26 05:44:50 UTC (rev 43273)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2010-08-26 08:27:17 UTC (rev 43274)
@@ -1825,12 +1825,11 @@
 
     @param cmd command (name of GRASS module)
     """
-    cmdout = os.popen(cmd + r' --interface-description', "r").read()
-    if not len(cmdout) > 0:
-        raise IOError, _("Unable to fetch interface description for command '%s'.") % cmd
-    p = re.compile('(grass-interface.dtd)')
-    p.search(cmdout)
-    cmdout = p.sub(globalvar.ETCDIR + r'/grass-interface.dtd', cmdout)
+    try:
+        cmdout = grass.Popen([cmd, '--interface-description'], stdout = grass.PIPE).communicate()[0]
+    except OSError:
+        raise gcmd.GException, _("Unable to fetch interface description for command '%s'.") % cmd
+    cmdout.replace('grass-interface.dtd', os.path.join(globalvar.ETCDIR, 'grass-interface.dtd'))
     
     return cmdout
 



More information about the grass-commit mailing list