[GRASS-SVN] r52000 - grass/trunk/lib/python
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Jun 7 12:05:05 PDT 2012
Author: martinl
Date: 2012-06-07 12:05:04 -0700 (Thu, 07 Jun 2012)
New Revision: 52000
Modified:
grass/trunk/lib/python/setup.py.sed
Log:
pythonlib: bugfix #1671 (patch suggested by artegion)
Modified: grass/trunk/lib/python/setup.py.sed
===================================================================
--- grass/trunk/lib/python/setup.py.sed 2012-06-07 10:31:28 UTC (rev 51999)
+++ grass/trunk/lib/python/setup.py.sed 2012-06-07 19:05:04 UTC (rev 52000)
@@ -13,7 +13,7 @@
...
@endcode
-(C) 2010-2011 by the GRASS Development Team
+(C) 2010-2012 by the GRASS Development Team
This program is free software under the GNU General Public
License (>=v2). Read the file COPYING that comes with GRASS
for details.
@@ -22,6 +22,7 @@
"""
import os
+import sys
import tempfile as tmpfile
def init(gisbase, dbase = '', location = 'demolocation', mapset = 'PERMANENT'):
@@ -36,11 +37,16 @@
@param mapset mapset within given location (default: 'PERMANENT')
@return path to gisrc file
"""
- os.environ['PATH'] += os.pathsep + os.path.join(gisbase, 'bin') + \
- os.pathsep + os.path.join(gisbase, 'scripts')
+ # define PATH
+ os.environ['PATH'] += os.pathsep + os.path.join(gisbase, 'bin')
+ os.environ['PATH'] += os.pathsep + os.path.join(gisbase, 'scripts')
+ if sys.platform.startswith('win'): # added for winGRASS
+ os.environ['PATH'] += os.pathsep + os.path.join(gisbase, 'extralib')
+ os.environ['PATH'] += os.pathsep + os.path.join(gisbase, 'msys', 'bin')
+ # define LD_LIBRARY_PATH
if '@LD_LIBRARY_PATH_VAR@' not in os.environ:
os.environ['@LD_LIBRARY_PATH_VAR@'] = ''
- os.environ['@LD_LIBRARY_PATH_VAR@'] += os.path.join(gisbase, 'lib')
+ os.environ['@LD_LIBRARY_PATH_VAR@'] += os.pathsep + os.path.join(gisbase, 'lib')
os.environ['GIS_LOCK'] = str(os.getpid())
@@ -48,9 +54,9 @@
path = os.getenv('PYTHONPATH')
dir = os.path.join(gisbase, 'etc', 'python')
if path:
- path = dir + os.pathsep + path
+ path = dir + os.pathsep + path
else:
- path = dir
+ path = dir
os.environ['PYTHONPATH'] = path
if not dbase:
More information about the grass-commit
mailing list