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

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jul 4 11:13:45 EDT 2009


Author: martinl
Date: 2009-07-04 11:13:44 -0400 (Sat, 04 Jul 2009)
New Revision: 38202

Modified:
   grass/trunk/gui/wxpython/gui_modules/mapdisp.py
   grass/trunk/gui/wxpython/gui_modules/utils.py
Log:
wxGUI: fix statusbar proj info (on failure)


Modified: grass/trunk/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2009-07-03 21:03:46 UTC (rev 38201)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2009-07-04 15:13:44 UTC (rev 38202)
@@ -556,6 +556,7 @@
                                                                                          key='projection',
                                                                                          subkey='proj4'),
                                                               flags = 'd')
+                    
                     if coord:
                         e, n = coord
                         if proj in ('ll', 'latlong', 'longlat'):
@@ -563,7 +564,7 @@
                         else:
                             self.statusbar.SetStatusText("%.2f; %.2f" % (e, n), 0)
                     else:
-                        self.statusbar.SetStatusText(_("Error in projection"), 0)
+                        self.statusbar.SetStatusText(_("Error in projection (check the settings)"), 0)
                 else:
                     if self.Map.projinfo['proj'] == 'll':
                         self.statusbar.SetStatusText("%s" % utils.Deg2DMS(e, n), 0)
@@ -914,7 +915,7 @@
                             self.statusbar.SetStatusText("%.2f - %.2f, %.2f - %.2f (%.2f, %.2f)" %
                                                          (w, e, s, n, ewres, nsres), 0)
                 else:
-                    self.statusbar.SetStatusText(_("Error in projection"), 0)
+                    self.statusbar.SetStatusText(_("Error in projection (check the settings)"), 0)
             else:
                 if self.Map.projinfo['proj'] == 'll':
                     w, s = utils.Deg2DMS(region["w"], region["s"],
@@ -1029,7 +1030,7 @@
                         self.statusbarWin['goto'].SetValue("%.2f; %.2f" % (coord[0],
                                                                            coord[1]))
                 else:
-                    self.statusbar.SetStatusText(_("Error in projection"), 0)
+                    self.statusbar.SetStatusText(_("Error in projection (check the settings)"), 0)
             else:
                 if self.Map.projinfo['proj'] == 'll':
                     self.statusbarWin['goto'].SetValue("%s" % utils.Deg2DMS(region['center_easting'], 

Modified: grass/trunk/gui/wxpython/gui_modules/utils.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/utils.py	2009-07-03 21:03:46 UTC (rev 38201)
+++ grass/trunk/gui/wxpython/gui_modules/utils.py	2009-07-04 15:13:44 UTC (rev 38202)
@@ -513,6 +513,9 @@
         if proj in ('ll', 'latlong', 'longlat') and 'd' not in flags:
             return (proj, (e, n))
         else:
-            return (proj, (float(e), float(n)))
+            try:
+                return (proj, (float(e), float(n)))
+            except ValueError:
+                return (None, None)
     
     return (None, None)



More information about the grass-commit mailing list