[GRASS-SVN] r56751 - grass/branches/develbranch_6/gui/wxpython/core

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jun 17 01:09:41 PDT 2013


Author: hamish
Date: 2013-06-17 01:09:41 -0700 (Mon, 17 Jun 2013)
New Revision: 56751

Modified:
   grass/branches/develbranch_6/gui/wxpython/core/gcmd.py
Log:
attempt to work around path environment setting issue (#86)

Modified: grass/branches/develbranch_6/gui/wxpython/core/gcmd.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/core/gcmd.py	2013-06-17 08:01:39 UTC (rev 56750)
+++ grass/branches/develbranch_6/gui/wxpython/core/gcmd.py	2013-06-17 08:09:41 UTC (rev 56751)
@@ -517,7 +517,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
@@ -527,8 +527,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
         



More information about the grass-commit mailing list