[GRASS-SVN] r42830 - in
grass/branches/releasebranch_6_4/gui/wxpython: . gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Jul 18 08:01:10 EDT 2010
Author: martinl
Date: 2010-07-18 12:01:10 +0000 (Sun, 18 Jul 2010)
New Revision: 42830
Modified:
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/globalvar.py
grass/branches/releasebranch_6_4/gui/wxpython/wxgui.py
Log:
don't ignore scripts in bin dir
Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/globalvar.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/globalvar.py 2010-07-18 11:13:15 UTC (rev 42829)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/globalvar.py 2010-07-18 12:01:10 UTC (rev 42830)
@@ -6,7 +6,7 @@
This module provide the space for global variables
used in the code.
-(C) 2007-2009 by the GRASS Development Team
+(C) 2007-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
@@ -130,7 +130,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/releasebranch_6_4/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/wxgui.py 2010-07-18 11:13:15 UTC (rev 42829)
+++ grass/branches/releasebranch_6_4/gui/wxpython/wxgui.py 2010-07-18 12:01:10 UTC (rev 42830)
@@ -281,24 +281,27 @@
def __createMenuItem(self, menu, label, help, handler, gcmd, kind=wx.ITEM_NORMAL):
"""Creates menu items"""
-
if not label:
menu.AppendSeparator()
return
-
+
if len(gcmd) > 0:
helpString = gcmd + ' -- ' + help
else:
helpString = help
-
+
menuItem = menu.Append(wx.ID_ANY, label, helpString, kind)
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(handler)
self.Bind(wx.EVT_MENU, rhandler, menuItem)
More information about the grass-commit
mailing list