[GRASS-SVN] r42388 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sat May 29 15:33:41 EDT 2010


Author: martinl
Date: 2010-05-29 15:33:40 -0400 (Sat, 29 May 2010)
New Revision: 42388

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/debug.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/gcmd.py
Log:
wxGUI: force flushing debug messages (required on MS Windows)
(merge r42387 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/debug.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/debug.py	2010-05-29 19:30:11 UTC (rev 42387)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/debug.py	2010-05-29 19:33:40 UTC (rev 42388)
@@ -54,6 +54,8 @@
         if self.debuglevel > 0 and level > 0 and level <= self.debuglevel:
             print >> sys.stderr, "GUI D%d/%d: %s" % (level, self.debuglevel, message)
         
+            sys.stderr.flush() # force flush (required for MS Windows)
+        
     def get_level(self):
         """!Return current GUI debug level"""
         return self.debuglevel

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gcmd.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gcmd.py	2010-05-29 19:30:11 UTC (rev 42387)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gcmd.py	2010-05-29 19:33:40 UTC (rev 42388)
@@ -363,6 +363,7 @@
                   verbose=None, wait=True, rerr=False,
                   stdout=None, stderr=None):
 
+        Debug.msg(1, "gcmd.Command(): %s" % ' '.join(cmd))
         self.cmd = cmd
         self.stderr = stderr
 	
@@ -610,6 +611,9 @@
 def RunCommand(prog, flags = "", overwrite = False, quiet = False, verbose = False,
                parent = None, read = False, stdin = None, getErrorMsg = False, **kwargs):
     """!Run GRASS command"""
+    Debug.msg(1, "gcmd.RunCommand(): %s" % ' '.join(grass.make_command(prog, flags, overwrite,
+                                                                       quiet, verbose, **kwargs)))
+    
     kwargs['stderr'] = subprocess.PIPE
     
     if read:



More information about the grass-commit mailing list