mailr12130 - /1.3/test_suite/formatting.py


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

Header


Content

Posted by edward on January 04, 2011 - 12:32:
Author: bugman
Date: Tue Jan  4 12:32:35 2011
New Revision: 12130

URL: http://svn.gna.org/viewcvs/relax?rev=12130&view=rev
Log:
Added a relax test suite formatting.subtitle() function for printing out 
subtitles.


Modified:
    1.3/test_suite/formatting.py

Modified: 1.3/test_suite/formatting.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/formatting.py?rev=12130&r1=12129&r2=12130&view=diff
==============================================================================
--- 1.3/test_suite/formatting.py (original)
+++ 1.3/test_suite/formatting.py Tue Jan  4 12:32:35 2011
@@ -50,6 +50,29 @@
         sys.stdout.write(" %-10s\n" % "[ Failed ]")
 
 
+def subtitle(text):
+    """Function for printing the subtitles.
+
+    @param text:    The text of the subtitle to be printed.
+    @type text:     str
+    """
+
+    # The width of the subtitle string.
+    width = len(text)
+
+    # Top spacing.
+    sys.stdout.write("\n\n")
+
+    # Text.
+    sys.stdout.write("# %s\n" % text)
+
+    # Bottom bar.
+    sys.stdout.write("#" * width)
+
+    # Spacing.
+    sys.stdout.write("\n\n")
+
+
 def title(text):
     """Function for printing the titles.
 




Related Messages


Powered by MHonArc, Updated Tue Jan 04 12:40:02 2011