Bläddra i källkod

wxGUI: force flushing debug messages (required on MS Windows)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@42387 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 15 år sedan
förälder
incheckning
8e29e75ad6
2 ändrade filer med 6 tillägg och 0 borttagningar
  1. 2 0
      gui/wxpython/gui_modules/debug.py
  2. 4 0
      gui/wxpython/gui_modules/gcmd.py

+ 2 - 0
gui/wxpython/gui_modules/debug.py

@@ -58,6 +58,8 @@ class DebugMsg:
             else:
             else:
                 print >> sys.stderr, "GUI D%d/%d: " % (level, self.debuglevel) + \
                 print >> sys.stderr, "GUI D%d/%d: " % (level, self.debuglevel) + \
                     message
                     message
+            sys.stderr.flush() # force flush (required for MS Windows)
+        
     def get_level(self):
     def get_level(self):
         """!Return current GUI debug level"""
         """!Return current GUI debug level"""
         return self.debuglevel
         return self.debuglevel

+ 4 - 0
gui/wxpython/gui_modules/gcmd.py

@@ -363,6 +363,7 @@ class Command:
         @param stdout  redirect standard output or None
         @param stdout  redirect standard output or None
         @param stderr  redirect standard error output or None
         @param stderr  redirect standard error output or None
         """
         """
+        Debug.msg(1, "gcmd.Command(): %s" % ' '.join(cmd))
         self.cmd = cmd
         self.cmd = cmd
         self.stderr = stderr
         self.stderr = stderr
 	
 	
@@ -610,6 +611,9 @@ class CommandThread(Thread):
 def RunCommand(prog, flags = "", overwrite = False, quiet = False, verbose = False,
 def RunCommand(prog, flags = "", overwrite = False, quiet = False, verbose = False,
                parent = None, read = False, stdin = None, getErrorMsg = False, **kwargs):
                parent = None, read = False, stdin = None, getErrorMsg = False, **kwargs):
     """!Run GRASS command"""
     """!Run GRASS command"""
+    Debug.msg(1, "gcmd.RunCommand(): %s" % ' '.join(grass.make_command(prog, flags, overwrite,
+                                                                       quiet, verbose, **kwargs)))
+    
     kwargs['stderr'] = subprocess.PIPE
     kwargs['stderr'] = subprocess.PIPE
     
     
     if read:
     if read: