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

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jan 24 18:05:04 EST 2012


Author: martinl
Date: 2012-01-24 15:05:04 -0800 (Tue, 24 Jan 2012)
New Revision: 50424

Modified:
   grass/trunk/gui/wxpython/core/globalvar.py
Log:
winGRASS: fix scanning scripts dir

Modified: grass/trunk/gui/wxpython/core/globalvar.py
===================================================================
--- grass/trunk/gui/wxpython/core/globalvar.py	2012-01-24 22:29:28 UTC (rev 50423)
+++ grass/trunk/gui/wxpython/core/globalvar.py	2012-01-24 23:05:04 UTC (rev 50424)
@@ -130,10 +130,16 @@
             else:
                 cmd.append(fname)
     
-    # scan scripts/ (not on MS Windows)
-    if not scripts and os.path.exists(os.path.join(gisbase, 'scripts')):
+    # scan scripts/
+    if os.path.exists(os.path.join(gisbase, 'scripts')):
         for fname in os.listdir(os.path.join(gisbase, 'scripts')):
-            cmd.append(fname)
+            if scripts: # win32
+                name, ext = os.path.splitext(fname)
+                if ext in scripts.keys():
+                    scripts[ext].append(name)
+                cmd.append(name)
+            else:
+                cmd.append(fname)
     
     # scan gui/scripts/
     if os.path.exists(os.path.join(gisbase, 'etc', 'gui', 'scripts')):



More information about the grass-commit mailing list