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

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Feb 20 03:55:12 PST 2016


Author: martinl
Date: 2016-02-20 03:55:12 -0800 (Sat, 20 Feb 2016)
New Revision: 67903

Modified:
   grass/trunk/gui/wxpython/core/toolboxes.py
Log:
wxGUI: fix _getAddons (use 'g.extension -ag')

Modified: grass/trunk/gui/wxpython/core/toolboxes.py
===================================================================
--- grass/trunk/gui/wxpython/core/toolboxes.py	2016-02-20 11:54:39 UTC (rev 67902)
+++ grass/trunk/gui/wxpython/core/toolboxes.py	2016-02-20 11:55:12 UTC (rev 67903)
@@ -480,12 +480,20 @@
 
 def _getAddons():
     try:
-        output = gcore.read_command('g.extension', quiet=True, flags='a')
+        output = gcore.read_command('g.extension', quiet=True, flags='ag')
     except CalledModuleError:
         _warning(_("List of addons cannot be obtained"
                    " because g.extension failed."))
         return []
-    return sorted(output.splitlines())
+    
+    flist = []
+    for line in output.splitlines():
+        if not line.startswith('executables'):
+            continue
+        for fexe in line.split('=', 1)[1].split(','):
+            flist.append(fexe)
+    
+    return sorted(flist)
 
 
 def _removeAddonsItem(node, addonsNodes):



More information about the grass-commit mailing list