[GRASS-SVN] r39924 - grass/branches/develbranch_6/gui/wxpython
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Dec 6 15:31:13 EST 2009
Author: cmbarton
Date: 2009-12-06 15:31:13 -0500 (Sun, 06 Dec 2009)
New Revision: 39924
Modified:
grass/branches/develbranch_6/gui/wxpython/wxgui.py
Log:
Fixed commands requiring xterms so that they work with Mac. Linux platforms might be able to use the same simplified routine, eliminating the need for extra coding and the xterm wrapper scripts.
Modified: grass/branches/develbranch_6/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/wxgui.py 2009-12-06 20:25:22 UTC (rev 39923)
+++ grass/branches/develbranch_6/gui/wxpython/wxgui.py 2009-12-06 20:31:13 UTC (rev 39924)
@@ -970,26 +970,37 @@
if line.startswith('x') and 'not running' in line:
xmonlist.append(line[0:2])
- # open available xmon
+ # find available xmon
xmon = xmonlist[0]
- gcmd.RunCommand('d.mon',
- start = xmon)
# run the command
- runbat = os.path.join(gisbase,'etc','grass-run.bat')
- xtermwrapper = os.path.join(gisbase,'etc','grass-xterm-wrapper')
- grassrun = os.path.join(gisbase,'etc','grass-run.sh')
command = ' '.join(command)
-
- if 'OS' in os.environ and os.environ['OS'] == "Windows_NT":
- cmdlist = ["cmd.exe", "/c", 'start "%s"' % runbat, command]
+
+ if sys.platform == "darwin":
+
+ cmdlist = ['xterm', '-e', 'd.mon', xmon]
+ p = gcmd.Command(cmdlist, wait=False)
+
+ cmdlist = ['xterm', '-e', command]
+ q = gcmd.Command(cmdlist, wait=False)
+
else:
- cmdlist = [xtermwrapper, '-e "%s"' % grassrun, command]
+ gcmd.RunCommand('d.mon',
+ start = xmon)
+
+ runbat = os.path.join(gisbase,'etc','grass-run.bat')
+ xtermwrapper = os.path.join(gisbase,'etc','grass-xterm-wrapper')
+ grassrun = os.path.join(gisbase,'etc','grass-run.sh')
+
+ if 'OS' in os.environ and os.environ['OS'] == "Windows_NT":
+ cmdlist = ["cmd.exe", "/c", 'start "%s"' % runbat, command]
+ else:
+ cmdlist = [xtermwrapper, '-e "%s"' % grassrun, command]
- p = gcmd.Command(cmdlist)
+ p = gcmd.Command(cmdlist)
- # reset display mode
- os.environ['GRASS_RENDER_IMMEDIATE'] = 'TRUE'
+ # reset display mode
+ os.environ['GRASS_RENDER_IMMEDIATE'] = 'TRUE'
def OnPreferences(self, event):
"""!General GUI preferences/settings"""
More information about the grass-commit
mailing list