[GRASS-SVN] r48548 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Sep 28 16:08:40 EDT 2011


Author: martinl
Date: 2011-09-28 13:08:40 -0700 (Wed, 28 Sep 2011)
New Revision: 48548

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py
Log:
wxGUI: add addons module to the path (be more safe)
       (merge r48547 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py	2011-09-28 20:07:09 UTC (rev 48547)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py	2011-09-28 20:08:40 UTC (rev 48548)
@@ -156,12 +156,16 @@
     
     if addons and os.getenv('GRASS_ADDON_PATH'):
         path = os.getenv('GRASS_ADDON_PATH')
-        for executable in os.listdir(os.path.join(path, 'bin')):
-            ext = os.path.splitext(executable)[1]
-            if not EXT_BIN or \
-                    ext in (EXT_BIN, EXT_SCT):
-                cmd.append(executable)
-        cmd += os.listdir(os.path.join(path, 'scripts'))
+        bpath = os.path.join(path, 'bin')
+        spath = os.path.join(path, 'scripts')
+        if os.path.exists(bpath) and os.path.isdir(bpath):
+            for executable in os.listdir(bpath):
+                ext = os.path.splitext(executable)[1]
+                if not EXT_BIN or \
+                        ext in (EXT_BIN, EXT_SCT):
+                    cmd.append(executable)
+        if os.path.exists(spath) and os.path.isdir(spath):
+            cmd += os.listdir(spath)
     
     if sys.platform == 'win32':
         for idx in range(len(cmd)):



More information about the grass-commit mailing list