[GRASS-SVN] r46859 - grass/trunk/lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jun 30 05:52:26 EDT 2011


Author: martinl
Date: 2011-06-30 02:52:26 -0700 (Thu, 30 Jun 2011)
New Revision: 46859

Modified:
   grass/trunk/lib/init/grass.py
Log:
check if GRASS_ADDON_PATH is undefined, then use $HOME/.grass7/addons


Modified: grass/trunk/lib/init/grass.py
===================================================================
--- grass/trunk/lib/init/grass.py	2011-06-30 07:39:13 UTC (rev 46858)
+++ grass/trunk/lib/init/grass.py	2011-06-30 09:52:26 UTC (rev 46859)
@@ -276,11 +276,14 @@
 
 def set_paths():
     addon_path = os.getenv('GRASS_ADDON_PATH')
-    if addon_path:
-	path_prepend(addon_path, 'PATH')
-        path_prepend(os.path.join(addon_path, 'scripts'), 'PATH')
-        path_prepend(os.path.join(addon_path, 'bin'), 'PATH')
+    if not addon_path:
+        addon_path = os.path.join(os.getenv('HOME'), '.grass7', 'addons')
+        message(_("GRASS_ADDON_PATH undefined, using '%s'") % addon_path)
     
+    path_prepend(addon_path, 'PATH')
+    path_prepend(os.path.join(addon_path, 'scripts'), 'PATH')
+    path_prepend(os.path.join(addon_path, 'bin'), 'PATH')
+    
     path_prepend(gfile('scripts'), 'PATH')
     path_prepend(gfile('bin'), 'PATH')
     



More information about the grass-commit mailing list