Update of /cvsroot/happydoc/HappyDoc3/happydoclib/docset
In directory sc8-pr-cvs1:/tmp/cvs-serv15827/happydoclib/docset
Modified Files:
base.py
Log Message:
Add option to control whether names are sorted.
Add method to filter names to enforce the includePrivateNames option.
Index: base.py
===================================================================
RCS file: /cvsroot/happydoc/HappyDoc3/happydoclib/docset/base.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** base.py 27 Dec 2002 18:35:55 -0000 1.10
--- base.py 28 Dec 2002 15:58:29 -0000 1.11
***************
*** 175,178 ****
--- 175,179 ----
includeComments=1,
includePrivateNames=1,
+ sortNames=0,
statusMessageFunc=None,
extraParameters={},
***************
*** 197,200 ****
--- 198,204 ----
is True.
+ sortNames=0 -- Boolean. True means to sort names before
+ generating output. Default is False.
+
statusMessageFunc -- function which will print a status
message for the user
***************
*** 205,209 ****
"""
! trace.into('DocSetBase', '__init__',
scanner=scanner,
title=title,
--- 209,213 ----
"""
! trace.into('DocSet', '__init__',
scanner=scanner,
title=title,
***************
*** 211,214 ****
--- 215,219 ----
includeComments=includeComments,
includePrivateNames=includePrivateNames,
+ sortNames=0,
statusMessageFunc=statusMessageFunc,
extraParameters=extraParameters,
***************
*** 227,230 ****
--- 232,236 ----
self.include_comments = includeComments
self.include_private_names = includePrivateNames
+ self.sort_names = sortNames
self._initializeWriters()
***************
*** 233,236 ****
--- 239,264 ----
return
+ def _filterNames(self, nameList):
+ """Remove names which should be ignored.
+
+ Parameters
+
+ nameList -- List of strings representing names of methods,
+ classes, functions, etc.
+
+ This method returns a list based on the contents of nameList.
+ If private names are being ignored, they are removed before
+ the list is returned.
+
+ """
+ if not self.include_private_names:
+ #nameList = filter(lambda x: ( (x[0] != '_') or (x[:2] == '__') ),
+ # nameList)
+ nameList = [ name
+ for name in nameList
+ if name and ((name[0] != '_') or (name[:2] == '__'))
+ ]
+ return nameList
+
def _skipInputFile(self, packageTreeNode):
"""False writer method used to notify the user that a node is being
***************
*** 527,531 ****
# Convert and write the text.
#
! html = converter.convert(text, 'html', level=3)
output.write(html)
return
--- 555,559 ----
# Convert and write the text.
#
! html = converter.convert(text, 'html', level=4)
output.write(html)
return
|