[GRASS-SVN] r60313 - grass/trunk/gui/wxpython/gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Sun May 18 06:17:31 PDT 2014


Author: annakrat
Date: 2014-05-18 06:17:31 -0700 (Sun, 18 May 2014)
New Revision: 60313

Modified:
   grass/trunk/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

Modified: grass/trunk/gui/wxpython/gui_core/menu.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/menu.py	2014-05-18 13:13:08 UTC (rev 60312)
+++ grass/trunk/gui/wxpython/gui_core/menu.py	2014-05-18 13:17:31 UTC (rev 60313)
@@ -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