[GRASS-SVN] r49918 - in grass/branches/develbranch_6:
gui/wxpython/core lib/init
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Dec 26 10:23:52 EST 2011
Author: martinl
Date: 2011-12-26 07:23:52 -0800 (Mon, 26 Dec 2011)
New Revision: 49918
Modified:
grass/branches/develbranch_6/gui/wxpython/core/globalvar.py
grass/branches/develbranch_6/lib/init/init.sh
Log:
init.sh: check also gisenv's ADDON_PATH
wxGUI: scan also GRASS_ADDON_PATH
Modified: grass/branches/develbranch_6/gui/wxpython/core/globalvar.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/core/globalvar.py 2011-12-26 14:15:28 UTC (rev 49917)
+++ grass/branches/develbranch_6/gui/wxpython/core/globalvar.py 2011-12-26 15:23:52 UTC (rev 49918)
@@ -143,29 +143,20 @@
os.environ["PATH"] = os.getenv("PATH") + os.pathsep + os.path.join(gisbase, 'etc', 'wxpython', 'scripts')
cmd = cmd + os.listdir(os.path.join(gisbase, 'etc', 'gui', 'scripts'))
- # scan addons
+
+ # scan addons (path)
if os.getenv('GRASS_ADDON_PATH'):
- path = os.getenv('GRASS_ADDON_PATH')
- bpath = os.path.join(path, 'bin')
- spath = os.path.join(path, 'scripts')
- if not scriptsOnly and os.path.exists(bpath) and \
- os.path.isdir(bpath):
- for fname in os.listdir(bpath):
+ for path in os.getenv('GRASS_ADDON_PATH').split(os.pathsep):
+ if not os.path.exists(path) or not os.path.isdir(path):
+ continue
+ for fname in os.listdir(path):
name, ext = os.path.splitext(fname)
- if not EXT_BIN:
- cmd.append(fname)
- elif ext == EXT_BIN:
+ if ext in [EXT_BIN, EXT_SCT]:
cmd.append(name)
-
- if os.path.exists(spath) and os.path.isdir(spath):
- for fname in os.listdir(spath):
- name, ext = os.path.splitext(fname)
- if not EXT_SCT:
- cmd.append(fname)
- elif ext == EXT_SCT:
- cmd.append(name)
+ else:
+ cmd.append(fname)
- return cmd
+ return set(cmd)
"""@brief Collected GRASS-relared binaries/scripts"""
grassCmd = {}
Modified: grass/branches/develbranch_6/lib/init/init.sh
===================================================================
--- grass/branches/develbranch_6/lib/init/init.sh 2011-12-26 14:15:28 UTC (rev 49917)
+++ grass/branches/develbranch_6/lib/init/init.sh 2011-12-26 15:23:52 UTC (rev 49918)
@@ -258,9 +258,13 @@
# if it doesn't exist set it to something so that g.extension's default is reasonable
if [ -z "$GRASS_ADDON_PATH" ] ; then
- GRASS_ADDON_PATH="$HOME/.grass6/addons"
- export GRASS_ADDON_PATH
+ if [ "$MINGW" ] ; then
+ GRASS_ADDON_PATH="$APPDATA/GRASS6/addons"
+ else
+ GRASS_ADDON_PATH="$HOME/.grass6/addons"
+ fi
fi
+export GRASS_ADDON_PATH
PATH="$GISBASE/bin:$GISBASE/scripts:$GRASS_ADDON_PATH:$PATH"
export PATH
@@ -727,6 +731,15 @@
exit 1
fi
+# check gisenv's ADDON_PATH
+ADDON_PATH=`g.gisenv ADDON_PATH`
+if [ -n "$ADDON_PATH" ] ; then
+ GRASS_ADDON_PATH="$GRASS_ADDON_PATH:$ADDON_PATH"
+ export GRASS_ADDON_PATH
+ PATH="$GISBASE/bin:$GISBASE/scripts:$GRASS_ADDON_PATH:$PATH"
+ export PATH
+fi
+
LOCATION="${GISDBASE?}/${LOCATION_NAME?}/${MAPSET?}"
# Check for concurrent use
More information about the grass-commit
mailing list