소스 검색

Quit wxGUI gracefully when g.region crashes (trac https://trac.osgeo.org/grass/ticket/493)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@35852 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 16 년 전
부모
커밋
e5f34b1936
1개의 변경된 파일9개의 추가작업 그리고 3개의 파일을 삭제
  1. 9 3
      gui/wxpython/gui_modules/render.py

+ 9 - 3
gui/wxpython/gui_modules/render.py

@@ -624,9 +624,15 @@ class Map(object):
             elif vect:
                 e.message = _("Unable to zoom to vector map <%s>.") % vect[0] + \
                 '%s%s' % (os.linesep, os.linesep) + e.message
-
-            print >> sys.stderr, e
-            return self.region
+            else:
+                e.message = _("Unable to get current geographic extent. "
+                              "Force quiting wxGUI. Please run manually g.region to "
+                              "fix the problem.")
+            e.Show()
+            if not rast and not vect:
+                sys.exit(1)
+            else:
+                return self.region
 
         for reg in ret.splitlines():
             key, val = reg.split("=", 1)