[GRASS-SVN] r53507 - in grass/branches/releasebranch_6_4/gui/wxpython: core gui_core modules

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Oct 19 08:10:33 PDT 2012


Author: martinl
Date: 2012-10-19 08:10:32 -0700 (Fri, 19 Oct 2012)
New Revision: 53507

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/core/globalvar.py
   grass/branches/releasebranch_6_4/gui/wxpython/gui_core/goutput.py
   grass/branches/releasebranch_6_4/gui/wxpython/modules/extensions.py
Log:
wxGUI: remove addon also from prompt
       (merge r53505 from trunk)


Modified: grass/branches/releasebranch_6_4/gui/wxpython/core/globalvar.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/core/globalvar.py	2012-10-19 15:05:15 UTC (rev 53506)
+++ grass/branches/releasebranch_6_4/gui/wxpython/core/globalvar.py	2012-10-19 15:10:32 UTC (rev 53507)
@@ -149,16 +149,25 @@
     
     return set(cmd), scripts
 
-def UpdateGRASSAddOnCommands():
+def UpdateGRASSAddOnCommands(eList = None):
     """!Update list of available GRASS AddOns commands to use when
     parsing string from the command line
+
+    @param eList list of AddOns commands to remove
     """
     global grassCmd, grassScripts
     
     # scan addons (path)
     if not os.getenv('GRASS_ADDON_PATH'):
         return
-    
+        
+    # remove commands first
+    if eList:
+        for ext in eList:
+            if ext in grassCmd:
+                grassCmd.remove(ext)
+        Debug.msg(1, "Number of removed AddOn commands: %d", len(eList))
+
     nCmd = 0
     for path in os.getenv('GRASS_ADDON_PATH').split(os.pathsep):
         if not os.path.exists(path) or not os.path.isdir(path):
@@ -172,6 +181,7 @@
                     continue
                 if name not in grassCmd:
                     grassCmd.add(name)
+                    Debug.msg(3, "AddOn commands: %s", name)
                     nCmd += 1
                 if ext == '.bat' and \
                         ext in grassScripts.keys() and \
@@ -180,6 +190,7 @@
             else:
                 if fname not in grassCmd:
                     grassCmd.add(fname)
+                    Debug.msg(3, "AddOn commands: %s", fname)
                     nCmd += 1
                     
     Debug.msg(1, "Number of new AddOn commands: %d", nCmd)

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_core/goutput.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_core/goutput.py	2012-10-19 15:05:15 UTC (rev 53506)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_core/goutput.py	2012-10-19 15:10:32 UTC (rev 53507)
@@ -983,6 +983,10 @@
         """!Reset focus"""
         self.cmdPrompt.SetFocus()
         
+    def GetPrompt(self):
+        """!Get prompt"""
+        return self.cmdPrompt
+
 class GMStdout:
     """!GMConsole standard output
 

Modified: grass/branches/releasebranch_6_4/gui/wxpython/modules/extensions.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/modules/extensions.py	2012-10-19 15:05:15 UTC (rev 53506)
+++ grass/branches/releasebranch_6_4/gui/wxpython/modules/extensions.py	2012-10-19 15:10:32 UTC (rev 53507)
@@ -467,6 +467,11 @@
         
         self.extList.LoadData()
         
+        # update prompt
+        globalvar.UpdateGRASSAddOnCommands(eList)
+        log = self.parent.GetLogWindow()
+        log.GetPrompt().SetFilter(None)
+        
     def OnCmdDialog(self, event):
         """!Shows command dialog"""
         GUI(parent = self).ParseCommand(cmd = ['g.extension.py'])



More information about the grass-commit mailing list