瀏覽代碼

winGRASS: fix scanning scripts dir

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@50424 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 13 年之前
父節點
當前提交
fb18656d9c
共有 1 個文件被更改,包括 9 次插入3 次删除
  1. 9 3
      gui/wxpython/core/globalvar.py

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

@@ -130,10 +130,16 @@ def GetGRASSCommands():
             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')):