mailr15758 - /1.3/prompt/base_class.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 - 16:36:
Author: bugman
Date: Tue Apr 17 16:36:41 2012
New Revision: 15758

URL: http://svn.gna.org/viewcvs/relax?rev=15758&view=rev
Log:
If the status.text_colouring flag is set, then the relax prompts will be 
coloured blue!


Modified:
    1.3/prompt/base_class.py

Modified: 1.3/prompt/base_class.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/prompt/base_class.py?rev=15758&r1=15757&r2=15758&view=diff
==============================================================================
--- 1.3/prompt/base_class.py (original)
+++ 1.3/prompt/base_class.py Tue Apr 17 16:36:41 2012
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2009-2010 Edward d'Auvergne                                  
 #
+# Copyright (C) 2009-2012 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -30,6 +30,7 @@
 
 # relax module imports.
 import help
+from status import Status; status = Status()
 from string import split, strip
 
 # The width of the text.
@@ -209,11 +210,6 @@
 class Exec_info:
     """Container for execution information."""
 
-    # The hard-coded prompts (to change the Python prompt, as well as the 
function print outs).
-    ps1 = 'relax> '
-    ps2 = 'relax| '
-    ps3 = '\nrelax> '
-
     def __init__(self):
         """Initialise the data of this container.
 
@@ -222,6 +218,17 @@
 
         # The user function intro flag.
         self.intro = True
+
+        # The prompts (to change the Python prompt, as well as the function 
print outs).
+        self.ps1 = 'relax> '
+        self.ps2 = 'relax| '
+        self.ps3 = '\n%s' % self.ps1
+
+        # Coloured text.
+        if status.text_colouring:
+            self.ps1 = "\033[94m%s\033[0m" % self.ps1
+            self.ps2 = "\033[94m%s\033[0m" % self.ps2
+            self.ps3 = "\n\033[94m%s\033[0m" % self.ps1
 
 
 




Related Messages


Powered by MHonArc, Updated Tue Apr 17 16:40:02 2012