mailr15766 - /1.3/prompt/interpreter.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on April 17, 2012 - 18:23:
Author: bugman
Date: Tue Apr 17 18:23:53 2012
New Revision: 15766

URL: http://svn.gna.org/viewcvs/relax?rev=15766&view=rev
Log:
The script print out in scripting mode is now in green if sys.stdout is a TTY.


Modified:
    1.3/prompt/interpreter.py

Modified: 1.3/prompt/interpreter.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/prompt/interpreter.py?rev=15766&r1=15765&r2=15766&view=diff
==============================================================================
--- 1.3/prompt/interpreter.py (original)
+++ 1.3/prompt/interpreter.py Tue Apr 17 18:23:53 2012
@@ -486,10 +486,20 @@
                 sys.stdout.write("\n")
                 return
 
+        # Coloured text.
+        if sys.stdout.isatty():
+            sys.stdout.write("\033[32m")
+
+        # Print the script.
         sys.stdout.write("script = " + repr(script_file) + "\n")
         
sys.stdout.write("----------------------------------------------------------------------------------------------------\n")
         sys.stdout.write(file.read())
         
sys.stdout.write("----------------------------------------------------------------------------------------------------\n")
+
+        # End coloured text.
+        if sys.stdout.isatty():
+            sys.stdout.write("\033[0m")
+
         file.close()
 
     # The execution flag.




Related Messages


Powered by MHonArc, Updated Tue Apr 17 18:40:01 2012