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

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Dec 15 11:38:41 EST 2011


Author: martinl
Date: 2011-12-15 08:38:41 -0800 (Thu, 15 Dec 2011)
New Revision: 49777

Modified:
   grass/trunk/gui/wxpython/core/globalvar.py
Log:
wxGUI: additional checks from GetGRASSCmds()
       (merge r49776 from devbr6)


Modified: grass/trunk/gui/wxpython/core/globalvar.py
===================================================================
--- grass/trunk/gui/wxpython/core/globalvar.py	2011-12-15 16:36:53 UTC (rev 49776)
+++ grass/trunk/gui/wxpython/core/globalvar.py	2011-12-15 16:38:41 UTC (rev 49777)
@@ -121,7 +121,7 @@
     cmd = list()
     
     # scan bin/
-    if not scriptsOnly:
+    if not scriptsOnly and os.path.exists(os.path.join(gisbase, 'bin')):
         for fname in os.listdir(os.path.join(gisbase, 'bin')):
             name, ext = os.path.splitext(fname)
             if not EXT_BIN:
@@ -130,16 +130,18 @@
                 cmd.append(name)
     
     # scan scripts/
-    for fname in os.listdir(os.path.join(gisbase, 'scripts')):
-        name, ext = os.path.splitext(fname)
-        if not EXT_SCT:
-            cmd.append(fname)
-        elif ext == EXT_SCT:
-            cmd.append(name)
+    if os.path.exists(os.path.join(gisbase, 'scripts')):
+        for fname in os.listdir(os.path.join(gisbase, 'scripts')):
+            name, ext = os.path.splitext(fname)
+            if not EXT_SCT:
+                cmd.append(fname)
+            elif ext == EXT_SCT:
+                cmd.append(name)
     
     # scan gui/scripts/
-    os.environ["PATH"] = os.getenv("PATH") + os.pathsep + os.path.join(gisbase, 'etc', 'gui', 'scripts')
-    cmd = cmd + os.listdir(os.path.join(gisbase, 'etc', 'gui', 'scripts'))
+    if os.path.exists(os.path.join(gisbase, 'etc', 'gui', 'scripts')):
+        os.environ["PATH"] = os.getenv("PATH") + os.pathsep + os.path.join(gisbase, 'etc', 'gui', 'scripts')
+        cmd = cmd + os.listdir(os.path.join(gisbase, 'etc', 'gui', 'scripts'))
     
     # scan addons
     if os.getenv('GRASS_ADDON_PATH'):



More information about the grass-commit mailing list