[GRASS-SVN] r49921 - grass/trunk/gui/wxpython/core
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Dec 26 11:03:20 EST 2011
Author: martinl
Date: 2011-12-26 08:03:20 -0800 (Mon, 26 Dec 2011)
New Revision: 49921
Modified:
grass/trunk/gui/wxpython/core/globalvar.py
Log:
wxGUI: silently skip invalid GRASS_ADDON_BASE
Modified: grass/trunk/gui/wxpython/core/globalvar.py
===================================================================
--- grass/trunk/gui/wxpython/core/globalvar.py 2011-12-26 15:47:05 UTC (rev 49920)
+++ grass/trunk/gui/wxpython/core/globalvar.py 2011-12-26 16:03:20 UTC (rev 49921)
@@ -147,28 +147,27 @@
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):
- name, ext = os.path.splitext(fname)
- if not EXT_BIN:
- cmd.append(fname)
- elif ext == EXT_BIN:
- cmd.append(name)
-
- 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)
- if not EXT_SCT:
- cmd.append(fname)
- elif ext == EXT_SCT:
- cmd.append(name)
-
+ continue
+
+ 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):
+ name, ext = os.path.splitext(fname)
+ if not EXT_BIN:
+ cmd.append(fname)
+ elif ext == EXT_BIN:
+ cmd.append(name)
+
+ 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)
+ if not EXT_SCT:
+ cmd.append(fname)
+ elif ext == EXT_SCT:
+ cmd.append(name)
+
# scan addons (path)
if os.getenv('GRASS_ADDON_PATH'):
for path in os.getenv('GRASS_ADDON_PATH').split(os.pathsep):
More information about the grass-commit
mailing list