[GRASS-SVN] r46768 - grass/trunk/lib/python

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jun 23 15:45:19 EDT 2011


Author: martinl
Date: 2011-06-23 12:45:19 -0700 (Thu, 23 Jun 2011)
New Revision: 46768

Modified:
   grass/trunk/lib/python/setup.py.sed
Log:
pythonlib: Set PYTHONPATH to find GRASS Python modules


Modified: grass/trunk/lib/python/setup.py.sed
===================================================================
--- grass/trunk/lib/python/setup.py.sed	2011-06-23 18:48:50 UTC (rev 46767)
+++ grass/trunk/lib/python/setup.py.sed	2011-06-23 19:45:19 UTC (rev 46768)
@@ -44,6 +44,15 @@
     
     os.environ['GIS_LOCK'] = str(os.getpid())
     
+    # Set PYTHONPATH to find GRASS Python modules
+    path = os.getenv('PYTHONPATH')
+    dir  = os.path.join(gisbase, 'etc', 'python')
+    if path:
+	path = dir + os.pathsep + path
+    else:
+	path = dir
+    os.environ['PYTHONPATH'] = path
+    
     if not dbase:
         dbase = gisbase
     
@@ -55,4 +64,3 @@
     os.close(fd)
     
     return gisrc
-



More information about the grass-commit mailing list