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

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Mar 26 10:04:00 EDT 2011


Author: martinl
Date: 2011-03-26 07:04:00 -0700 (Sat, 26 Mar 2011)
New Revision: 45761

Modified:
   grass/trunk/gui/wxpython/gui_modules/mapdisp.py
   grass/trunk/gui/wxpython/gui_modules/render.py
Log:
wxGUI: fail gracefully when g.region/g.proj are missing
(merge r45760 from devbr6)


Modified: grass/trunk/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2011-03-26 13:57:48 UTC (rev 45760)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2011-03-26 14:04:00 UTC (rev 45761)
@@ -512,6 +512,10 @@
     def _initDisplay(self):
         """!Initialize map display, set dimensions and map region
         """
+        if not grass.find_program('g.region', ['--help']):
+            sys.exit(_("GRASS module '%s' not found. Unable to start map "
+                       "display window.") % 'g.region')
+        
         self.width, self.height = self.GetClientSize()
         
         Debug.msg(2, "MapFrame._initDisplay():")

Modified: grass/trunk/gui/wxpython/gui_modules/render.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/render.py	2011-03-26 13:57:48 UTC (rev 45760)
+++ grass/trunk/gui/wxpython/gui_modules/render.py	2011-03-26 14:04:00 UTC (rev 45761)
@@ -416,6 +416,9 @@
         """!Return region projection and map units information
         """
         projinfo = dict()
+        if not grass.find_program('g.proj', ['--help']):
+            sys.exit(_("GRASS module '%s' not found. Unable to start map "
+                       "display window.") % 'g.proj')
         
         ret = self._runCommand(gcmd.RunCommand, prog = 'g.proj',
                                read = True, flags = 'p')



More information about the grass-commit mailing list