[GRASS-SVN] r39410 - grass/branches/releasebranch_6_4/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Oct 5 08:19:53 EDT 2009


Author: martinl
Date: 2009-10-05 08:19:52 -0400 (Mon, 05 Oct 2009)
New Revision: 39410

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp.py
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/vdigit.py
Log:
tracback vdigit errors


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp.py	2009-10-05 09:26:12 UTC (rev 39409)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp.py	2009-10-05 12:19:52 UTC (rev 39410)
@@ -4134,6 +4134,21 @@
         if showCompExtent:
             self.MapWindow.regionCoords = []
         
+    def IsStandalone(self):
+        """!Check if Map display is standalone"""
+        if self.gismanager:
+            return False
+        
+        return True
+    
+    def GetLayerManager(self):
+        """!Get reference to Layer Manager
+
+        @return window reference
+        @return None (if standalone)
+        """
+        return self.gismanager
+
 # end of class MapFrame
 
 class MapApp(wx.App):

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/vdigit.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/vdigit.py	2009-10-05 09:26:12 UTC (rev 39409)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/vdigit.py	2009-10-05 12:19:52 UTC (rev 39410)
@@ -35,6 +35,7 @@
 import sys
 import string
 import copy
+import traceback
 
 from threading import Thread
 
@@ -122,9 +123,9 @@
             ret = self.driver.Reset(self.map)
         except StandardError, e:
             raise gcmd.DigitError(parent=self.mapWindow.parent,
-                                  message="%s %s (%s)" % (_('Unable to initialize display driver, '
-                                                            'see README file for more information.\n\n'
-                                                            'Details:'), e, errorMsg))
+                                  message="%s %s (%s)" % (_("Unable to initialize display driver of vector "
+                                                            "digitizer. See 'Command output' for details.\n\n"
+                                                            "Details:"), e, errorMsg))
         
         if map and ret == -1:
             raise gcmd.DigitError(parent=self.mapWindow.parent,
@@ -219,15 +220,22 @@
         @param settings  initial settings of digitization tool
         """
         AbstractDigit.__init__(self, mapwindow)
-
+        
+        if not mapwindow.parent.IsStandalone():
+            self.log = mapwindow.parent.GetLayerManager().goutput.cmd_stderr
+        else:
+            self.log = sys.stderr
+        
+        self.toolbar = mapwindow.parent.toolbars['vdigit']
+        
         try:
             self.digit = wxvdigit.Digit(self.driver.GetDevice(),
                                         mapwindow)
-        except (ImportError, NameError):
+        except (ImportError, NameError, TypeError):
+            # print traceback
+            traceback.print_exc(file = self.log)
             self.digit = None
-
-        self.toolbar = mapwindow.parent.toolbars['vdigit']
-
+        
         self.UpdateSettings()
         
     def __del__(self):



More information about the grass-commit mailing list