[GRASS-SVN] r49776 - grass/branches/develbranch_6/gui/wxpython/core

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Dec 15 11:36:53 EST 2011


Author: martinl
Date: 2011-12-15 08:36:53 -0800 (Thu, 15 Dec 2011)
New Revision: 49776

Modified:
   grass/branches/develbranch_6/gui/wxpython/core/globalvar.py
Log:
wxGUI: additional checks from GetGRASSCmds()


Modified: grass/branches/develbranch_6/gui/wxpython/core/globalvar.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/core/globalvar.py	2011-12-15 16:05:24 UTC (rev 49775)
+++ grass/branches/develbranch_6/gui/wxpython/core/globalvar.py	2011-12-15 16:36:53 UTC (rev 49776)
@@ -120,7 +120,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:
@@ -129,16 +129,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