[GRASS-SVN] r44312 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Nov 15 04:15:24 EST 2010


Author: martinl
Date: 2010-11-15 01:15:24 -0800 (Mon, 15 Nov 2010)
New Revision: 44312

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI: show error dialog when module is not the search path


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2010-11-14 09:31:52 UTC (rev 44311)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2010-11-15 09:15:24 UTC (rev 44312)
@@ -351,11 +351,19 @@
         self.label = ''
         self.flags = list()
         self.keywords = list()
-        
+        self.errorMsg = ''
+
         if grassModule is not None:
-            processTask(tree = etree.fromstring(getInterfaceDescription(grassModule)),
-                        task = self)
+            try:
+                processTask(tree = etree.fromstring(getInterfaceDescription(grassModule)),
+                            task = self)
+            except gcmd.GException, e:
+                self.errorMsg = str(e)
         
+    def get_error_msg(self):
+        """!Get error message ('' for no error)"""
+        return self.errorMsg
+    
     def get_name(self):
         """!Get task name"""
         return self.name
@@ -1954,6 +1962,11 @@
         wx.App.__init__(self, False)
         
     def OnInit(self):
+        msg = self.grass_task.get_error_msg()
+        if msg:
+            gcmd.GError(msg + '\n\nTry to set up GRASS_ADDON_PATH variable.')
+            return True
+        
         self.mf = mainFrame(parent = None, ID = wx.ID_ANY, task_description = self.grass_task)
         self.mf.CentreOnScreen()
         self.mf.Show(True)



More information about the grass-commit mailing list