[GRASS-SVN] r49909 - grass/trunk/gui/wxpython/core

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Dec 25 18:08:45 EST 2011


Author: martinl
Date: 2011-12-25 15:08:45 -0800 (Sun, 25 Dec 2011)
New Revision: 49909

Modified:
   grass/trunk/gui/wxpython/core/globalvar.py
Log:
wxGUI: don't fail when addon paths do not exist


Modified: grass/trunk/gui/wxpython/core/globalvar.py
===================================================================
--- grass/trunk/gui/wxpython/core/globalvar.py	2011-12-25 22:56:32 UTC (rev 49908)
+++ grass/trunk/gui/wxpython/core/globalvar.py	2011-12-25 23:08:45 UTC (rev 49909)
@@ -146,6 +146,8 @@
     # 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')
             if not scriptsOnly and os.path.exists(bpath) and \
                     os.path.isdir(bpath):
@@ -168,6 +170,8 @@
     # scan addons (path)
     if os.getenv('GRASS_ADDON_PATH'):
         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 ext in [EXT_BIN, EXT_SCT]:



More information about the grass-commit mailing list