[GRASS-SVN] r44313 - grass/trunk/gui/wxpython/gui_modules

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


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

Modified:
   grass/trunk/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI: show error dialog when module is not the search path
(merge r44312 from devbr6)


Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py	2010-11-15 09:15:24 UTC (rev 44312)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py	2010-11-15 09:17:24 UTC (rev 44313)
@@ -387,11 +387,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
@@ -2120,6 +2128,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