[GRASS-SVN] r60754 - grass/branches/releasebranch_7_0/gui/wxpython/gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jun 8 06:39:18 PDT 2014


Author: annakrat
Date: 2014-06-08 06:39:18 -0700 (Sun, 08 Jun 2014)
New Revision: 60754

Modified:
   grass/branches/releasebranch_7_0/gui/wxpython/gui_core/menu.py
Log:
wxGUI/menu: don't disable non-grass commands in menu, motivation is creating toolboxes from non-grass commands such as Isis (merge from trunk, r60313)

Modified: grass/branches/releasebranch_7_0/gui/wxpython/gui_core/menu.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gui_core/menu.py	2014-06-08 13:33:09 UTC (rev 60753)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gui_core/menu.py	2014-06-08 13:39:18 UTC (rev 60754)
@@ -18,7 +18,7 @@
 @author Robert Szczepanek (menu customization)
 @author Vaclav Petras <wenzeslaus gmail.com> (menu customization)
 """
-
+import re
 import wx
 
 from core              import globalvar
@@ -90,8 +90,10 @@
             try: 
                 cmd = utils.split(str(command)) 
             except UnicodeError: 
-                cmd = utils.split(EncodeString((command))) 
-            if cmd and cmd[0] not in globalvar.grassCmd: 
+                cmd = utils.split(EncodeString((command)))
+            # disable only grass commands which are not present (e.g. r.in.lidar)
+            if cmd and cmd[0] not in globalvar.grassCmd and \
+               re.match('[rvdipmgt][3bs]?\.([a-z0-9\.])+', cmd[0]):
                 menuItem.Enable(False)
 
         rhandler = eval('self.parent.' + handler)



More information about the grass-commit mailing list