mailr10629 - in /1.3: intro.py relax


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

Header


Content

Posted by edward on February 03, 2010 - 18:16:
Author: bugman
Date: Wed Feb  3 18:15:59 2010
New Revision: 10629

URL: http://svn.gna.org/viewcvs/relax?rev=10629&view=rev
Log:
Shifted the spacing() method from relax to the intro module and renamed it to 
centre().

The docstring has also been expanded to include epydoc tags.


Modified:
    1.3/intro.py
    1.3/relax

Modified: 1.3/intro.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/intro.py?rev=10629&r1=10628&r2=10629&view=diff
==============================================================================
--- 1.3/intro.py (original)
+++ 1.3/intro.py Wed Feb  3 18:15:59 2010
@@ -63,3 +63,24 @@
         self.errors = []
         if not dep_check.C_module_exp_fn:
             self.errors.append(dep_check.C_module_exp_fn_mesg)
+
+
+    def centre(self, string, width=100):
+        """Format the string to be centred to a certain number of spaces.
+
+        @param string:  The string to centre.
+        @type string:   str
+        @keyword width: The number of characters to centre to.
+        @type width:    int
+        @return:        The centred string with leading whitespace added.
+        @rtype:         str
+        """
+
+        # Calculate the number of spaces needed.
+        spaces = (width - len(string)) / 2
+
+        # The new string.
+        string = spaces * ' ' + string
+
+        # Return the new string.
+        return string

Modified: 1.3/relax
URL: 
http://svn.gna.org/viewcvs/relax/1.3/relax?rev=10629&r1=10628&r2=10629&view=diff
==============================================================================
--- 1.3/relax (original)
+++ 1.3/relax Wed Feb  3 18:15:59 2010
@@ -303,19 +303,6 @@
         help(gpl)
 
 
-    def spacing(self, string, width=100):
-        """Function for formatting the string to be centred to 100 spaces."""
-
-        # Calculate the number of spaces needed.
-        spaces = (width - len(string)) / 2
-
-        # The new string.
-        string = spaces * ' ' + string
-
-        # Return the new string.
-        return string
-
-
     def test_mode(self):
         """Relax test mode code."""
 




Related Messages


Powered by MHonArc, Updated Wed Feb 03 18:40:02 2010