[GRASS-SVN] r49907 - grass/trunk/lib/init
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Dec 25 17:42:57 EST 2011
Author: martinl
Date: 2011-12-25 14:42:57 -0800 (Sun, 25 Dec 2011)
New Revision: 49907
Modified:
grass/trunk/lib/init/grass.py
grass/trunk/lib/init/variables.html
Log:
add gisenv variable - ADDON_PATH
Modified: grass/trunk/lib/init/grass.py
===================================================================
--- grass/trunk/lib/init/grass.py 2011-12-25 22:26:36 UTC (rev 49906)
+++ grass/trunk/lib/init/grass.py 2011-12-25 22:42:57 UTC (rev 49907)
@@ -628,6 +628,15 @@
location = os.path.join(gisdbase, location_name, mapset)
+ # convert selected gisenv variables to environmental variables
+ if kv.get('ADDON_PATH'):
+ addon_path = kv.get('ADDON_PATH')
+ if os.getenv('GRASS_ADDON_PATH'):
+ os.environ['GRASS_ADDON_PATH'] += os.pathsep + addon_path
+ else:
+ os.environ['GRASS_ADDON_PATH'] = addon_path
+ path_prepend(addon_path, 'PATH')
+
def check_lock():
global lockfile
if not os.path.exists(location):
Modified: grass/trunk/lib/init/variables.html
===================================================================
--- grass/trunk/lib/init/variables.html 2011-12-25 22:26:36 UTC (rev 49906)
+++ grass/trunk/lib/init/variables.html 2011-12-25 22:42:57 UTC (rev 49907)
@@ -423,6 +423,11 @@
be inherited by dependent modules as the script runs. Setting either the
GRASS_OVERWRITE environment variable or the OVERWRITE gisenv variable detailed
below will cause maps with identical names to be overwritten.</dd>
+
+ <dt>ADDON_PATH</dt>
+ <dd>[grass startup script]<br> allows to specify additional paths to
+ local GRASS modules or user scripts extra to standard GRASS
+ distribution.</dd>
</dl>
<h2>GRASS-related Files</h2>
More information about the grass-commit
mailing list