[GRASS-SVN] r42831 -
grass/branches/develbranch_6/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Jul 18 09:10:45 EDT 2010
Author: martinl
Date: 2010-07-18 13:10:45 +0000 (Sun, 18 Jul 2010)
New Revision: 42831
Modified:
grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/menu.py
Log:
don't ignore scripts in bin dir
(merge r42830 from relbr64)
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py 2010-07-18 12:01:10 UTC (rev 42830)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py 2010-07-18 13:10:45 UTC (rev 42831)
@@ -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/branches/develbranch_6/gui/wxpython/gui_modules/menu.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menu.py 2010-07-18 12:01:10 UTC (rev 42830)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menu.py 2010-07-18 13:10:45 UTC (rev 42831)
@@ -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