[GRASS-SVN] r50416 - in grass/branches/develbranch_6/gui/wxpython:
core gui_core
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jan 24 11:33:01 EST 2012
Author: martinl
Date: 2012-01-24 08:33:01 -0800 (Tue, 24 Jan 2012)
New Revision: 50416
Modified:
grass/branches/develbranch_6/gui/wxpython/core/gcmd.py
grass/branches/develbranch_6/gui/wxpython/core/utils.py
grass/branches/develbranch_6/gui/wxpython/gui_core/forms.py
grass/branches/develbranch_6/gui/wxpython/gui_core/prompt.py
Log:
wxGUI: move GetRealCmd from `utils` module to `gcmd`
(merge r50415 from trunk)
Modified: grass/branches/develbranch_6/gui/wxpython/core/gcmd.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/core/gcmd.py 2012-01-24 16:29:50 UTC (rev 50415)
+++ grass/branches/develbranch_6/gui/wxpython/core/gcmd.py 2012-01-24 16:33:01 UTC (rev 50416)
@@ -53,8 +53,17 @@
from core import globalvar
from core.debug import Debug
-from core.utils import GetRealCmd
+def GetRealCmd(cmd):
+ """!Return real command name - only for MS Windows
+ """
+ if sys.platform == 'win32':
+ for ext in globalvar.grassScripts.keys():
+ if cmd in globalvar.grassScripts[ext]:
+ return cmd + ext
+
+ return cmd
+
def DecodeString(string):
"""!Decode string using system encoding
Modified: grass/branches/develbranch_6/gui/wxpython/core/utils.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/core/utils.py 2012-01-24 16:29:50 UTC (rev 50415)
+++ grass/branches/develbranch_6/gui/wxpython/core/utils.py 2012-01-24 16:33:01 UTC (rev 50416)
@@ -21,7 +21,7 @@
import re
import locale
-from core.globalvar import ETCDIR, grassScripts
+from core.globalvar import ETCDIR
sys.path.append(os.path.join(ETCDIR, "python"))
from grass.script import core as grass
@@ -764,13 +764,3 @@
return os.path.join(os.getenv('APPDATA'), 'grass%d' % version)
return os.path.join(os.getenv('HOME'), '.grass%d' % version)
-
-def GetRealCmd(cmd):
- """!Return real command name - only for MS Windows
- """
- if sys.platform == 'win32':
- for ext in grassScripts.keys():
- if cmd in grassScripts[ext]:
- return cmd + ext
-
- return cmd
Modified: grass/branches/develbranch_6/gui/wxpython/gui_core/forms.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_core/forms.py 2012-01-24 16:29:50 UTC (rev 50415)
+++ grass/branches/develbranch_6/gui/wxpython/gui_core/forms.py 2012-01-24 16:33:01 UTC (rev 50416)
@@ -1833,7 +1833,7 @@
# parse the interface decription
try:
global _blackList
- self.grass_task = gtask.parse_interface(utils.GetRealCmd(cmd[0]),
+ self.grass_task = gtask.parse_interface(gcmd.GetRealCmd(cmd[0]),
blackList = _blackList)
except (grass.ScriptError, ValueError), e:
raise gcmd.GException(e.value)
@@ -1985,7 +1985,7 @@
if sys.argv[1] != 'test':
q = wx.LogNull()
cmd = utils.split(sys.argv[1])
- task = gtask.grassTask(utils.GetRealCmd(cmd[0]))
+ task = gtask.grassTask(gcmd.GetRealCmd(cmd[0]))
task.set_options(cmd[1:])
app = GrassGUIApp(task)
app.MainLoop()
Modified: grass/branches/develbranch_6/gui/wxpython/gui_core/prompt.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_core/prompt.py 2012-01-24 16:29:50 UTC (rev 50415)
+++ grass/branches/develbranch_6/gui/wxpython/gui_core/prompt.py 2012-01-24 16:33:01 UTC (rev 50416)
@@ -35,7 +35,7 @@
from core import globalvar
from core import utils
from lmgr.menudata import ManagerData
-from core.gcmd import EncodeString, DecodeString
+from core.gcmd import EncodeString, DecodeString, GetRealCmd
class PromptListCtrl(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin):
"""!PopUp window used by GPromptPopUp"""
@@ -804,7 +804,7 @@
self.OnCmdErase(None)
else:
try:
- self.cmdDesc = gtask.parse_interface(utils.GetRealCmd(cmd))
+ self.cmdDesc = gtask.parse_interface(GetRealCmd(cmd))
except IOError:
self.cmdDesc = None
@@ -1042,7 +1042,7 @@
if cmd not in globalvar.grassCmd:
return
- info = gtask.command_info(utils.GetRealCmd(cmd))
+ info = gtask.command_info(GetRealCmd(cmd))
self.CallTipSetBackground("#f4f4d1")
self.CallTipSetForeground("BLACK")
@@ -1120,7 +1120,7 @@
(not self.cmdDesc or cmd != self.cmdDesc.get_name()):
try:
- self.cmdDesc = gtask.parse_interface(utils.GetRealCmd(cmd))
+ self.cmdDesc = gtask.parse_interface(GetRealCmd(cmd))
except IOError:
self.cmdDesc = None
event.Skip()
More information about the grass-commit
mailing list