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

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jul 18 10:11:00 EDT 2010


Author: martinl
Date: 2010-07-18 14:10:59 +0000 (Sun, 18 Jul 2010)
New Revision: 42832

Modified:
   grass/trunk/gui/wxpython/gui_modules/globalvar.py
   grass/trunk/gui/wxpython/gui_modules/menu.py
Log:
don't ignore scripts in bin dir
(merge r42830 from relbr64)


Modified: grass/trunk/gui/wxpython/gui_modules/globalvar.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/globalvar.py	2010-07-18 13:10:45 UTC (rev 42831)
+++ grass/trunk/gui/wxpython/gui_modules/globalvar.py	2010-07-18 14:10:59 UTC (rev 42832)
@@ -143,7 +143,9 @@
     cmd = list()
     if bin is True:
         for file in os.listdir(os.path.join(gisbase, 'bin')):
-            if not EXT_BIN or file[-4:] == EXT_BIN:
+            if not EXT_BIN or \
+                    file[-4:] == EXT_BIN or \
+                    file[-4:] == EXT_SCT:
                 cmd.append(file)
         
         # add special call for setting vector colors

Modified: grass/trunk/gui/wxpython/gui_modules/menu.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menu.py	2010-07-18 13:10:45 UTC (rev 42831)
+++ grass/trunk/gui/wxpython/gui_modules/menu.py	2010-07-18 14:10:59 UTC (rev 42832)
@@ -1,3 +1,20 @@
+"""!
+ at package menu.py
+
+ at brief Menu classes for wxGUI
+
+Classes:
+ - Menu
+
+(C) 2010 by the GRASS Development Team
+This program is free software under the GNU General Public License
+(>=v2). Read the file COPYING that comes with GRASS for details.
+
+ at author Martin Landa <landa.martin gmail.com>
+"""
+
+import shlex
+
 import wx
 
 import globalvar
@@ -50,9 +67,13 @@
         
         self.menucmd[menuItem.GetId()] = gcmd
         
-        if len(gcmd) > 0 and \
-                gcmd.split()[0] not in globalvar.grassCmd['all']:
-            menuItem.Enable (False)
+        if gcmd: 
+            try: 
+                cmd = shlex.split(str(gcmd)) 
+            except UnicodeError: 
+                cmd = shlex.split(utils.EncodeString((gcmd))) 
+            if cmd and cmd[0] not in globalvar.grassCmd['all']: 
+                menuItem.Enable(False)
         
         rhandler = eval('self.parent.' + handler)
         



More information about the grass-commit mailing list