[GRASS-SVN] r56784 - in grass/branches/releasebranch_6_4: gui/wxpython/core scripts/d.rast.edit

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jun 18 04:26:03 PDT 2013


Author: hamish
Date: 2013-06-18 04:26:03 -0700 (Tue, 18 Jun 2013)
New Revision: 56784

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/core/gcmd.py
   grass/branches/releasebranch_6_4/scripts/d.rast.edit/d.rast.edit.tcl
Log:
don't require the aspect map on wingrass; attempt to work around path environment setting issue (#86, merge from devbr6)

Modified: grass/branches/releasebranch_6_4/gui/wxpython/core/gcmd.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/core/gcmd.py	2013-06-18 11:09:16 UTC (rev 56783)
+++ grass/branches/releasebranch_6_4/gui/wxpython/core/gcmd.py	2013-06-18 11:26:03 UTC (rev 56784)
@@ -525,7 +525,7 @@
         
         self.startTime = time.time()
         
-        # TODO: replace ugly hack bellow
+        # TODO: replace ugly hack below
         args = self.cmd
         if sys.platform == 'win32' and os.path.splitext(self.cmd[0])[1] == '.py':
             # Python GUI script should be replaced by Shell scripts
@@ -535,8 +535,12 @@
                 self.cmd[0] in globalvar.grassScripts[globalvar.SCT_EXT]:
             args[0] = self.cmd[0] + globalvar.SCT_EXT
             env = copy.deepcopy(self.env)
-            env['PATH'] = os.path.join(os.getenv('GISBASE').replace('/', '\\'), 'scripts') + \
-                os.pathsep + env['PATH']
+            # FIXME: env is None?  hmph. borrow sys.path instead.
+            #env['PATH'] = os.path.join(os.getenv('GISBASE').replace('/', '\\'), 'scripts') + \
+            #    os.pathsep + env['PATH']
+            scriptdir = os.path.join(os.getenv('GISBASE').replace('/', '\\'), 'scripts')
+            if scriptdir not in sys.path:
+                sys.path.append(scriptdir)
         else:
             env = self.env
         

Modified: grass/branches/releasebranch_6_4/scripts/d.rast.edit/d.rast.edit.tcl
===================================================================
--- grass/branches/releasebranch_6_4/scripts/d.rast.edit/d.rast.edit.tcl	2013-06-18 11:09:16 UTC (rev 56783)
+++ grass/branches/releasebranch_6_4/scripts/d.rast.edit/d.rast.edit.tcl	2013-06-18 11:26:03 UTC (rev 56784)
@@ -12,7 +12,11 @@
 
 set outmap $env(GIS_OPT_OUTPUT)
 set inmap $env(GIS_OPT_INPUT)
-set aspect $env(GIS_OPT_ASPECT)
+if {[info exists env(GIS_OPT_ASPECT)]} {
+    set aspect $env(GIS_OPT_ASPECT)
+} else {
+    set aspect ""
+}
 set width $env(GIS_OPT_WIDTH)
 set height $env(GIS_OPT_HEIGHT)
 set size $env(GIS_OPT_SIZE)



More information about the grass-commit mailing list