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

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 25 14:08:40 EDT 2010


Author: martinl
Date: 2010-08-25 18:08:40 +0000 (Wed, 25 Aug 2010)
New Revision: 43266

Modified:
   grass/trunk/gui/wxpython/gui_modules/menuform.py
Log:
attempt to fix #1137


Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py	2010-08-25 15:09:45 UTC (rev 43265)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py	2010-08-25 18:08:40 UTC (rev 43266)
@@ -1989,12 +1989,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