Bläddra i källkod

libpython/setup: define also GRASS_PYTHON if not defined

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@67288 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 9 år sedan
förälder
incheckning
59f48e00d0
1 ändrade filer med 7 tillägg och 2 borttagningar
  1. 7 2
      lib/python/script/setup.py

+ 7 - 2
lib/python/script/setup.py

@@ -171,8 +171,13 @@ def init(gisbase, dbase='', location='demolocation', mapset='PERMANENT'):
 
 
     os.environ['GIS_LOCK'] = str(os.getpid())
     os.environ['GIS_LOCK'] = str(os.getpid())
 
 
-    # Set PYTHONPATH to find GRASS Python modules
-    # TODO: isn't this useless? user already imported this somehow
+    # Set GRASS_PYTHON and PYTHONPATH to find GRASS Python modules
+    if not os.getenv('GRASS_PYTHON'):
+        if sys.platform == 'win32':
+            os.environ['GRASS_PYTHON'] = "python.exe"
+        else:
+            os.environ['GRASS_PYTHON'] = "python"
+    
     path = os.getenv('PYTHONPATH')
     path = os.getenv('PYTHONPATH')
     etcpy = os.path.join(gisbase, 'etc', 'python') + os.pathsep + os.path.join(gisbase, 'gui', 'wxpython')
     etcpy = os.path.join(gisbase, 'etc', 'python') + os.pathsep + os.path.join(gisbase, 'gui', 'wxpython')
     if path:
     if path: