mailr14092 - /branches/gui_testing/gui/controller.py


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

Header


Content

Posted by edward on August 03, 2011 - 20:24:
Author: bugman
Date: Wed Aug  3 20:24:06 2011
New Revision: 14092

URL: http://svn.gna.org/viewcvs/relax?rev=14092&view=rev
Log:
The relax prompt is now coloured blue in the relax controller log element.


Modified:
    branches/gui_testing/gui/controller.py

Modified: branches/gui_testing/gui/controller.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/controller.py?rev=14092&r1=14091&r2=14092&view=diff
==============================================================================
--- branches/gui_testing/gui/controller.py (original)
+++ branches/gui_testing/gui/controller.py Wed Aug  3 20:24:06 2011
@@ -498,6 +498,9 @@
         # Create the STDERR style (with assignment 1).
         self.StyleSetForeground(1, wx.NamedColour('red'))
 
+        # Create the relax prompt style (assignment 2).
+        self.StyleSetForeground(2, wx.NamedColour('blue'))
+
         # Bind events.
         self.Bind(wx.EVT_KEY_DOWN, self.capture_keys)
 
@@ -533,6 +536,22 @@
 
             # Get the data.
             msg, stream = self.log_queue.get()
+
+            # The relax prompt.
+            if msg[1:7] == 'relax>':
+                # Add a new line to the last block.
+                string_list[-1] += '\n'
+
+                # Add the prompt part.
+                string_list.append('relax>')
+                stream_list.append(2)
+
+                # Shorten the message.
+                msg = msg[7:]
+
+                # Start a new section.
+                string_list.append('')
+                stream_list.append(stream)
 
             # A different stream.
             if stream_list[-1] != stream:
@@ -598,15 +617,15 @@
             # Add the text.
             self.AppendText(string_list[i])
 
-            # STDERR style.
-            if stream_list[i] == 1:
+            # The different styles.
+            if stream_list[i] != 0:
                 # Get the text extents.
                 len_string = len(string_list[i].encode('utf8'))
                 end = self.GetLength()
 
                 # Change the style.
                 self.StartStyling(end - len_string, 31)
-                self.SetStyling(len_string, 1)
+                self.SetStyling(len_string, stream_list[i])
 
         # Limit the scroll back.
         self.limit_scrollback()




Related Messages


Powered by MHonArc, Updated Wed Aug 03 21:40:02 2011