Prechádzať zdrojové kódy

attempt to fix https://trac.osgeo.org/grass/ticket/1137

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@43266 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 14 rokov pred
rodič
commit
0571b6b466
1 zmenil súbory, kde vykonal 5 pridanie a 6 odobranie
  1. 5 6
      gui/wxpython/gui_modules/menuform.py

+ 5 - 6
gui/wxpython/gui_modules/menuform.py

@@ -1989,12 +1989,11 @@ def getInterfaceDescription(cmd):
 
     @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