|
@@ -144,11 +144,13 @@ def GetGRASSCmds(scriptsOnly = False):
|
|
|
cmd = cmd + os.listdir(os.path.join(gisbase, 'etc', 'gui', 'scripts'))
|
|
|
|
|
|
# scan addons (base)
|
|
|
- if os.getenv('GRASS_ADDON_BASE'):
|
|
|
- for path in os.getenv('GRASS_ADDON_BASE').split(os.pathsep):
|
|
|
- if not os.path.exists(path) or not os.path.isdir(path):
|
|
|
- continue
|
|
|
- bpath = os.path.join(path, 'bin')
|
|
|
+ addons_base = os.getenv('GRASS_ADDON_BASE')
|
|
|
+ if addons_base:
|
|
|
+ if not os.path.exists(addons_base) or not os.path.isdir(addons_base):
|
|
|
+ sys.stderr.write(_("%s (%s) is not valid\n") % \
|
|
|
+ ("GRASS_ADDON_BASE", addons_base))
|
|
|
+ else:
|
|
|
+ bpath = os.path.join(addons_base, 'bin')
|
|
|
if not scriptsOnly and os.path.exists(bpath) and \
|
|
|
os.path.isdir(bpath):
|
|
|
for fname in os.listdir(bpath):
|
|
@@ -158,7 +160,7 @@ def GetGRASSCmds(scriptsOnly = False):
|
|
|
elif ext == EXT_BIN:
|
|
|
cmd.append(name)
|
|
|
|
|
|
- spath = os.path.join(path, 'scripts')
|
|
|
+ spath = os.path.join(addons_base, 'scripts')
|
|
|
if os.path.exists(spath) and os.path.isdir(spath):
|
|
|
for fname in os.listdir(spath):
|
|
|
name, ext = os.path.splitext(fname)
|