[orca] Fix for bug #628300 - Write the errors to the sdterr instead of sdtout



commit 505a4c7978780385951eac84c80a9a2bb215d094
Author: Juanje Ojeda <jojeda emergya es>
Date:   Mon Aug 30 10:44:26 2010 +0100

    Fix for bug #628300 - Write the errors to the sdterr instead of sdtout

 src/orca/debug.py |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/debug.py b/src/orca/debug.py
index 51d7425..38d8668 100644
--- a/src/orca/debug.py
+++ b/src/orca/debug.py
@@ -30,6 +30,7 @@ __license__   = "LGPL"
 
 import traceback
 import pyatspi
+import sys
 
 # Used to turn off all debugging.
 #
@@ -137,7 +138,10 @@ def printStack(level):
         println(level)
 
 def println(level, text = ""):
-    """Prints the text to stdout if debug is enabled.
+    """Prints the text to stderr unless debug is enabled.
+
+    If debug is enabled the text will be redirected to the
+    file debugFile.
 
     Arguments:
     - level: the accepted debug level
@@ -148,7 +152,7 @@ def println(level, text = ""):
         if debugFile:
             debugFile.writelines([text, "\n"])
         else:
-            print text
+            sys.stderr.writelines([text, "\n"])
 
 def printObjectEvent(level, event, sourceInfo=None):
     """Prints out an Python Event object.  The given level may be



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]