Browse Source

winGRASS: fix scanning scripts dir

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@50424 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 13 years ago
parent
commit
fb18656d9c
1 changed files with 9 additions and 3 deletions
  1. 9 3
      gui/wxpython/core/globalvar.py

+ 9 - 3
gui/wxpython/core/globalvar.py

@@ -130,10 +130,16 @@ def GetGRASSCommands():
             else:
             else:
                 cmd.append(fname)
                 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')):
         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/
     # scan gui/scripts/
     if os.path.exists(os.path.join(gisbase, 'etc', 'gui', 'scripts')):
     if os.path.exists(os.path.join(gisbase, 'etc', 'gui', 'scripts')):