Update of /cvsroot/happydoc/HappyDoc3/happydoclib/docset
In directory sc8-pr-cvs1:/tmp/cvs-serv8016/happydoclib/docset
Modified Files:
base.py
Log Message:
Refactor writeText() into formatText() and writeText() so that
formatText() can be reused.
Index: base.py
===================================================================
RCS file: /cvsroot/happydoc/HappyDoc3/happydoclib/docset/base.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** base.py 19 Jan 2003 22:04:40 -0000 1.15
--- base.py 15 Mar 2003 14:24:07 -0000 1.16
***************
*** 544,555 ****
return str
! def writeText(self, output, text, textFormat):
! """Format and write the 'text' to the 'output'.
Arguments:
! 'output' -- Stream to which 'text' should be written.
!
! 'text' -- String to be written.
'textFormat' -- String identifying the format of 'text' so
--- 544,553 ----
return str
! def formatText(self, text, textFormat):
! """Returns text formatted appropriately for output by this docset.
Arguments:
! 'text' -- String to be formatted.
'textFormat' -- String identifying the format of 'text' so
***************
*** 561,566 ****
"""
- if not text:
- return
text = self._unquoteString(text)
#
--- 559,562 ----
***************
*** 578,581 ****
--- 574,599 ----
#
html = converter.convert(text, 'html', level=4)
+ return html
+
+ def writeText(self, output, text, textFormat):
+ """Format and write the 'text' to the 'output'.
+
+ Arguments:
+
+ 'output' -- Stream to which 'text' should be written.
+
+ 'text' -- String to be written.
+
+ 'textFormat' -- String identifying the format of 'text' so
+ the formatter can use a docstring converter to convert the
+ body of 'text' to the appropriate output format.
+
+ 'quote=1' -- Boolean option to control whether the text
+ should be quoted to escape special characters.
+
+ """
+ if not text:
+ return
+ html = self.formatText(text, textFormat)
output.write(html)
return
|