[GRASS-SVN] r59148 - grass/trunk/gui/wxpython/core

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Feb 28 03:32:05 PST 2014


Author: martinl
Date: 2014-02-28 03:32:05 -0800 (Fri, 28 Feb 2014)
New Revision: 59148

Modified:
   grass/trunk/gui/wxpython/core/render.py
Log:
wxGUI: try to recover when WIND is broken

Modified: grass/trunk/gui/wxpython/core/render.py
===================================================================
--- grass/trunk/gui/wxpython/core/render.py	2014-02-27 10:28:18 UTC (rev 59147)
+++ grass/trunk/gui/wxpython/core/render.py	2014-02-28 11:32:05 UTC (rev 59148)
@@ -397,7 +397,9 @@
         
         # setting some initial env. variables
         self._initGisEnv() # g.gisenv
-        self.GetWindow()
+        if not self.GetWindow():
+            sys.stderr.write(_("Trying to recover from default region..."))
+            RunCommand('g.region', flags='d')
         
         # info to report progress
         self.progressInfo = None
@@ -492,7 +494,12 @@
         
         for line in windfile.readlines():
             line = line.strip()
-            key, value = line.split(":", 1)
+            try:
+                key, value = line.split(":", 1)
+            except ValueError, e:
+                sys.stderr.write(_("\nERROR: Unable to read WIND file: %s\n") % e)
+                return None
+            
             self.wind[key.strip()] = value.strip()
         
         windfile.close()



More information about the grass-commit mailing list