mailr16298 - in /branches/uf_redesign/prompt: uf_docstring.py uf_objects.py


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

Header


Content

Posted by edward on May 13, 2012 - 18:12:
Author: bugman
Date: Sun May 13 18:12:56 2012
New Revision: 16298

URL: http://svn.gna.org/viewcvs/relax?rev=16298&view=rev
Log:
The uf_docstring functions are no longer private.


Modified:
    branches/uf_redesign/prompt/uf_docstring.py
    branches/uf_redesign/prompt/uf_objects.py

Modified: branches/uf_redesign/prompt/uf_docstring.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/prompt/uf_docstring.py?rev=16298&r1=16297&r2=16298&view=diff
==============================================================================
--- branches/uf_redesign/prompt/uf_docstring.py (original)
+++ branches/uf_redesign/prompt/uf_docstring.py Sun May 13 18:12:56 2012
@@ -34,7 +34,7 @@
 from status import Status; status = Status()
 
 
-def _bold_text(text):
+def bold_text(text):
     """Convert the text to bold.
 
     This is for use in the help system.
@@ -56,7 +56,7 @@
     return new_text
 
 
-def _build_doc(fn):
+def build_doc(fn):
     """Build the fn.__doc__ docstring.
 
     @param fn:  The user function to build the docstring for.
@@ -71,33 +71,33 @@
 
     # Add the keyword args.
     if hasattr(fn, '_doc_args'):
-        fn.__doc__ = fn.__doc__ + _build_subtitle("Keyword Arguments")
+        fn.__doc__ = fn.__doc__ + build_subtitle("Keyword Arguments")
         for arg, desc in fn._doc_args:
             # The text.
             text = "%s:  %s" % (arg, desc)
 
             # Format.
-            text = _format_text(text)
+            text = format_text(text)
 
             # Add to the docstring.
             fn.__doc__ = "%s%s\n" % (fn.__doc__, text)
 
     # Add the description.
     if hasattr(fn, '_doc_desc'):
-        fn.__doc__ = fn.__doc__ + _build_subtitle("Description")
-        fn.__doc__ = fn.__doc__ + _format_text(fn._doc_desc)
+        fn.__doc__ = fn.__doc__ + build_subtitle("Description")
+        fn.__doc__ = fn.__doc__ + format_text(fn._doc_desc)
 
     # Add the examples.
     if hasattr(fn, '_doc_examples'):
-        fn.__doc__ = fn.__doc__ + '\n' + _build_subtitle("Examples")
-        fn.__doc__ = fn.__doc__ + _format_text(fn._doc_examples)
+        fn.__doc__ = fn.__doc__ + '\n' + build_subtitle("Examples")
+        fn.__doc__ = fn.__doc__ + format_text(fn._doc_examples)
 
     # Add the additional sections.
     if hasattr(fn, '_doc_additional'):
         # Loop over each section.
         for i in range(len(fn._doc_additional)):
-            fn.__doc__ = fn.__doc__ + '\n' + 
_build_subtitle(fn._doc_additional[i][0])
-            fn.__doc__ = fn.__doc__ + _format_text(fn._doc_additional[i][1])
+            fn.__doc__ = fn.__doc__ + '\n' + 
build_subtitle(fn._doc_additional[i][0])
+            fn.__doc__ = fn.__doc__ + format_text(fn._doc_additional[i][1])
 
     # Convert the _doc_args list into a dictionary for easy argument 
description retrieval.
     if hasattr(fn, '_doc_args'):
@@ -110,7 +110,7 @@
 
 
 
-def _build_subtitle(text, bold=True):
+def build_subtitle(text, bold=True):
     """Create the formatted subtitle string.
 
     @param text:        The name of the subtitle.
@@ -123,7 +123,7 @@
 
     # Bold.
     if bold:
-        new = "\n%s\n\n" % _bold_text(text)
+        new = "\n%s\n\n" % bold_text(text)
 
     # Underline.
     else:
@@ -133,7 +133,7 @@
     return new
 
 
-def _format_text(text):
+def format_text(text):
     """Format the text by stripping whitespace and wrapping.
 
     @param text:    The text to strip and wrap.

Modified: branches/uf_redesign/prompt/uf_objects.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/prompt/uf_objects.py?rev=16298&r1=16297&r2=16298&view=diff
==============================================================================
--- branches/uf_redesign/prompt/uf_objects.py (original)
+++ branches/uf_redesign/prompt/uf_objects.py Sun May 13 18:12:56 2012
@@ -240,34 +240,34 @@
         self.__relax_help__ = ""
 
         # Add the title.
-        self.__relax_help__ = "%s%s\n" % (self.__relax_help__, 
_bold_text(self._title))
+        self.__relax_help__ = "%s%s\n" % (self.__relax_help__, 
bold_text(self._title))
 
         # Add the keyword args.
         if self._kargs != None:
-            self.__relax_help__ += _build_subtitle("Keyword Arguments")
+            self.__relax_help__ += build_subtitle("Keyword Arguments")
             for i in range(len(self._kargs)):
                 # The text.
                 text = "%s:  %s" % (self._kargs[i]['name'], 
self._kargs[i]['desc'])
 
                 # Format.
-                text = _format_text(text)
+                text = format_text(text)
 
                 # Add to the docstring.
                 self.__relax_help__ = "%s%s\n" % (self.__relax_help__, text)
 
         # Add the description.
         if self._desc != None:
-            self.__relax_help__ += _build_subtitle("Description")
-            self.__relax_help__ += _format_text(self._desc)
+            self.__relax_help__ += build_subtitle("Description")
+            self.__relax_help__ += format_text(self._desc)
 
         # Add the additional sections.
         if self._additional != None:
             # Loop over each section.
             for i in range(len(self._additional)):
-                self.__relax_help__ += '\n%s' % 
_build_subtitle(self._additional[i][0])
-                self.__relax_help__ += _format_text(self._additional[i][1])
+                self.__relax_help__ += '\n%s' % 
build_subtitle(self._additional[i][0])
+                self.__relax_help__ += format_text(self._additional[i][1])
 
         # Add the examples.
         if self._examples != None:
-            self.__relax_help__ += '\n%s' % _build_subtitle("Examples")
-            self.__relax_help__ += _format_text(self._examples)
+            self.__relax_help__ += '\n%s' % build_subtitle("Examples")
+            self.__relax_help__ += format_text(self._examples)




Related Messages


Powered by MHonArc, Updated Sun May 13 18:20:02 2012