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

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Mar 26 09:57:48 EDT 2011


Author: martinl
Date: 2011-03-26 06:57:48 -0700 (Sat, 26 Mar 2011)
New Revision: 45760

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/render.py
Log:
wxGUI: fail gracefully when g.region/g.proj are missing


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py	2011-03-26 11:22:14 UTC (rev 45759)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py	2011-03-26 13:57:48 UTC (rev 45760)
@@ -510,6 +510,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/branches/develbranch_6/gui/wxpython/gui_modules/render.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/render.py	2011-03-26 11:22:14 UTC (rev 45759)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/render.py	2011-03-26 13:57:48 UTC (rev 45760)
@@ -447,6 +447,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