mailr15771 - in /1.3: ansi.py 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 - 19:04:
Author: bugman
Date: Tue Apr 17 19:04:04 2012
New Revision: 15771

URL: http://svn.gna.org/viewcvs/relax?rev=15771&view=rev
Log:
Shifted the script colouring ANSI escape sequences into the 'ansi' module.


Modified:
    1.3/ansi.py
    1.3/prompt/interpreter.py

Modified: 1.3/ansi.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/ansi.py?rev=15771&r1=15770&r2=15771&view=diff
==============================================================================
--- 1.3/ansi.py (original)
+++ 1.3/ansi.py Tue Apr 17 19:04:04 2012
@@ -33,6 +33,9 @@
 # RelaxWarnings.
 relax_warning = "\033[33m"
 
+# Script print out.
+script = "\033[32m"
+
 # The terminating sequence.
 end = "\033[0m"
 

Modified: 1.3/prompt/interpreter.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/prompt/interpreter.py?rev=15771&r1=15770&r2=15771&view=diff
==============================================================================
--- 1.3/prompt/interpreter.py (original)
+++ 1.3/prompt/interpreter.py Tue Apr 17 19:04:04 2012
@@ -27,6 +27,7 @@
 import dep_check
 
 # Python module imports.
+import ansi
 from code import InteractiveConsole, softspace
 from os import F_OK, access, chdir, getcwd, path
 import platform
@@ -488,7 +489,7 @@
 
         # Coloured text.
         if sys.stdout.isatty():
-            sys.stdout.write("\033[32m")
+            sys.stdout.write(ansi.script)
 
         # Print the script.
         sys.stdout.write("script = " + repr(script_file) + "\n")
@@ -498,7 +499,7 @@
 
         # End coloured text.
         if sys.stdout.isatty():
-            sys.stdout.write("\033[0m")
+            sys.stdout.write(ansi.end)
 
         file.close()
 




Related Messages


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