Author: bugman Date: Fri Jul 1 17:05:39 2011 New Revision: 13379 URL: http://svn.gna.org/viewcvs/relax?rev=13379&view=rev Log: The _build_doc() base function now only builds sections if they exist. Modified: branches/gui_testing/prompt/base_class.py Modified: branches/gui_testing/prompt/base_class.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/prompt/base_class.py?rev=13379&r1=13378&r2=13379&view=diff ============================================================================== --- branches/gui_testing/prompt/base_class.py (original) +++ branches/gui_testing/prompt/base_class.py Fri Jul 1 17:05:39 2011 @@ -53,24 +53,27 @@ fn.__doc__ = "%s%s\n" % (fn.__doc__, fn._doc_title) # Add the keyword args. - 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) - - # Add to the docstring. - fn.__doc__ = "%s%s\n" % (fn.__doc__, text) + if hasattr(fn, '_doc_args'): + 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) + + # Add to the docstring. + fn.__doc__ = "%s%s\n" % (fn.__doc__, text) # Add the description. - fn.__doc__ = fn.__doc__ + _build_subtitle("Description") - fn.__doc__ = fn.__doc__ + _format_text(fn._doc_desc) + if hasattr(fn, '_doc_desc'): + fn.__doc__ = fn.__doc__ + _build_subtitle("Description") + fn.__doc__ = fn.__doc__ + _format_text(fn._doc_desc) # Add the examples. - fn.__doc__ = fn.__doc__ + '\n' + _build_subtitle("Examples") - fn.__doc__ = fn.__doc__ + _format_text(fn._doc_examples) + if hasattr(fn, '_doc_examples'): + fn.__doc__ = fn.__doc__ + '\n' + _build_subtitle("Examples") + fn.__doc__ = fn.__doc__ + _format_text(fn._doc_examples) def _build_subtitle(text):