瀏覽代碼

wxGUI: dmon does not report errors after exiting GRASS (author Vaclav Petras)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@51829 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 13 年之前
父節點
當前提交
5f0e39261c
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      gui/wxpython/mapdisp/main.py

+ 9 - 0
gui/wxpython/mapdisp/main.py

@@ -260,6 +260,15 @@ class MapApp(wx.App):
         """!Redraw, if new layer appears (check's timestamp of
         cmdfile)
         """
+        try:
+            # GISBASE and other sytem enviromental variables can not be used
+            # since the process inherited them from GRASS
+            # raises exception when vaiable does not exists
+            grass.gisenv()['GISDBASE']
+        except KeyError:
+            self.timer.Stop()
+            return
+        
         # todo: events
         if os.path.getmtime(monFile['cmd']) > self.cmdTimeStamp:
             self.timer.Stop()