mailr12129 - /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:31:
Author: bugman
Date: Tue Jan  4 12:31:09 2011
New Revision: 12129

URL: http://svn.gna.org/viewcvs/relax?rev=12129&view=rev
Log:
Renamed the relax test suite formatting.heading() function to title() and 
simplified it.


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=12129&r1=12128&r2=12129&view=diff
==============================================================================
--- 1.3/test_suite/formatting.py (original)
+++ 1.3/test_suite/formatting.py Tue Jan  4 12:31:09 2011
@@ -21,30 +21,6 @@
 
###############################################################################
 
 import sys
-
-
-def heading(text):
-    """Function for printing the headings.
-
-    @param text:    The text of the heading to be printed.
-    @type text:     str
-    """
-
-    # Spacing.
-    sys.stdout.write("\n\n\n\n")
-
-    # Top bar.
-    for i in xrange(len(text) + 4):
-        sys.stdout.write("#")
-    sys.stdout.write("\n")
-
-    # Text.
-    sys.stdout.write("# " + text + " #\n")
-
-    # Bottom bar.
-    for i in xrange(len(text) + 4):
-        sys.stdout.write("#")
-    sys.stdout.write("\n\n\n")
 
 
 def summary_line(name, passed, width=64):
@@ -72,3 +48,30 @@
     # Failed.
     else:
         sys.stdout.write(" %-10s\n" % "[ Failed ]")
+
+
+def title(text):
+    """Function for printing the titles.
+
+    @param text:    The text of the title to be printed.
+    @type text:     str
+    """
+
+    # The width of the title string.
+    width = len(text) + 4
+
+    # Top spacing.
+    sys.stdout.write("\n\n\n\n")
+
+    # Top bar.
+    sys.stdout.write("#" * width)
+    sys.stdout.write("\n")
+
+    # Text.
+    sys.stdout.write("# %s #\n" % text)
+
+    # Bottom bar.
+    sys.stdout.write("#" * width)
+
+    # Spacing.
+    sys.stdout.write("\n\n\n")




Related Messages


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