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

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 19 08:00:33 EDT 2008


Author: martinl
Date: 2008-03-19 08:00:32 -0400 (Wed, 19 Mar 2008)
New Revision: 30640

Modified:
   grass/trunk/gui/wxpython/gui_modules/dbm.py
   grass/trunk/gui/wxpython/gui_modules/gcmd.py
Log:
wxGUI (dbm) fetch layer name if given
(gcmd) error handling fixed, some error messages (i.e. from G_parser()) are formatted regardless GRASS_MESSAGE_FORMAT=gui


Modified: grass/trunk/gui/wxpython/gui_modules/dbm.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/dbm.py	2008-03-19 11:21:49 UTC (rev 30639)
+++ grass/trunk/gui/wxpython/gui_modules/dbm.py	2008-03-19 12:00:32 UTC (rev 30640)
@@ -2973,11 +2973,18 @@
         # list of available layers & (table, database, driver)
         for line in layerCommand.ReadStdOutput():
             lineList = line.split(' ')
-            self.layers[int(lineList[0])] = { "table"    : lineList[1],
-                                              "key"      : lineList[2],
-                                              "database" : lineList[3],
-                                              "driver"   : lineList[4] }
-
+            if '/' in lineList[0]:
+                lineList[0], layer_name = lineList[0].split('/')
+            else:
+                layer_name = None
+            self.layers[int(lineList[0])] = {
+                "name"     : layer_name,
+                "table"    : lineList[1],
+                "key"      : lineList[2],
+                "database" : lineList[3],
+                "driver"   : lineList[4]
+                }
+            
         if (len(self.layers.keys()) == 0):
             return False
 

Modified: grass/trunk/gui/wxpython/gui_modules/gcmd.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gcmd.py	2008-03-19 11:21:49 UTC (rev 30639)
+++ grass/trunk/gui/wxpython/gui_modules/gcmd.py	2008-03-19 12:00:32 UTC (rev 30640)
@@ -358,7 +358,8 @@
                                     os.linesep, os.linesep,
                                     _("Details:"),
                                     os.linesep,
-                                    self.PrintModuleOutput()))
+                                    self.cmdThread.rerr))
+#                                    self.PrintModuleOutput()))
                 elif rerr == sys.stderr: # redirect message to sys
                     stderr.write("Execution failed: '%s'" % (' '.join(self.cmd)))
                     stderr.write("%sDetails:%s%s" % (os.linesep,
@@ -370,7 +371,6 @@
             Debug.msg (3, "Command(): cmd='%s', wait=%s, returncode=?, alive=%s" % \
                            (' '.join(cmd), wait, self.cmdThread.isAlive()))
 
-
         if message_format:
             os.environ["GRASS_MESSAGE_FORMAT"] = message_format
         else:
@@ -574,7 +574,7 @@
                 # line = self.__read_all(self.module.stderr)
                 line = recv_some(self.module, e=0, stderr=1)
                 self.stderr.write(line)
-
+                
         # get the last output
         if self.stdout:
             # line = self.__read_all(self.module.stdout)
@@ -586,7 +586,7 @@
             self.stderr.write(line)
 
         self.rerr = self.__parseString(line)
-
+       
         if hasattr(self.stderr, "gmstc"):
             # -> GMConsole
             if self._want_abort: # abort running process
@@ -612,6 +612,10 @@
                 err += line + '%s' % os.linesep
             elif err != '' and 'GRASS_INFO_END' in line:
                 err += line
+            elif 'ERROR' in line:
+                err += line
+            elif err != '':
+                err += line
                 
         return err
         



More information about the grass-commit mailing list