Update of /cvsroot/happydoc/HappyDoc3/happydoclib/docset
In directory sc8-pr-cvs1:/tmp/cvs-serv30386/happydoclib/docset
Modified Files:
docset_MultiHTMLFile.py
Log Message:
Move function for building relative HREF between two nodes to base
class where it can be shared.
Update use of getSubNodes() now that it takes a list of mimetypes.
Index: docset_MultiHTMLFile.py
===================================================================
RCS file: /cvsroot/happydoc/HappyDoc3/happydoclib/docset/docset_MultiHTMLFile.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** docset_MultiHTMLFile.py 18 Jan 2003 22:14:24 -0000 1.16
--- docset_MultiHTMLFile.py 16 Mar 2003 20:18:24 -0000 1.17
***************
*** 316,386 ****
return
- def _computeRelativeHREF(self, source, destination):
- """Compute the HREF to point from the output file of source to destination.
- """
- trace.into('MultiHTMLFileDocSet', '_computeRelativeHREF',
- source=source.getName(),
- destination=destination.getName(),
- outputLevel=TRACE_LEVEL,
- )
-
- relative_path = source.getPathToNode(destination)
- trace.writeVar(relative_path=relative_path,
- outputLevel=TRACE_LEVEL)
- if not relative_path:
- output_name = self.getOutputFilenameForPackageTreeNode(
- destination,
- includePath=0,
- )
- trace.outof(output_name, outputLevel=TRACE_LEVEL)
- return output_name
-
- destination_mimetype = destination.getMimeType()[0]
- source_mimetype = source.getMimeType()[0]
-
- #
- # Pointing to a class defined by source module.
- #
- if ( (len(relative_path) == 1)
- and
- (destination_mimetype == 'application/x-class')
- and
- (source_mimetype == 'text/x-python')
- and
- (source.get(destination.getName()) is not None)
- ):
- trace.write('adding source to relative path',
- outputLevel=TRACE_LEVEL)
- relative_path = (source.getName(), relative_path[0])
-
- destination_name = destination.getName()
- if relative_path[-1] == destination_name:
- #
- # Need to replace with output name.
- #
- output_name = self.getOutputFilenameForPackageTreeNode(
- destination,
- includePath=0,
- )
- trace.write('Replacing %s with %s' % (relative_path[-1],
- output_name,
- ),
- outputLevel=TRACE_LEVEL,
- )
- relative_path = relative_path[:-1] + (output_name,)
-
- #
- # If the destination is a directory, add 'index.html' to the end.
- #
- #print destination.getName(), destination.getMimeType()
- #if destination.getMimeType() == ('application/x-directory', None):
- # print 'adding index.html'
- # relative_path += ('index.html',)
- # print relative_path
-
- href = '/'.join(relative_path)
- trace.outof(href, outputLevel=TRACE_LEVEL)
- return href
-
def _getAnchorTagForPackageTreeNode(self,
source,
--- 316,319 ----
***************
*** 534,541 ****
# converted.
#
! plain_text_files = packageTreeNode.getSubNodes('text/plain')
! structured_text_files = packageTreeNode.getSubNodes('text/x-structured')
! html_files = packageTreeNode.getSubNodes('text/html')
! text_files = plain_text_files + structured_text_files + html_files
self.writeTOCReferencesSection(
output,
--- 467,474 ----
# converted.
#
! text_files = packageTreeNode.getSubNodes(['text/plain',
! 'text/x-structured',
! 'text/html',
! ])
self.writeTOCReferencesSection(
output,
***************
*** 552,556 ****
packageTreeNode,
'Python files',
! [ node for node in packageTreeNode.getSubNodes('text/x-python')
if node.getName() != '__init__.py'
],
--- 485,489 ----
packageTreeNode,
'Python files',
! [ node for node in packageTreeNode.getSubNodes(['text/x-python'])
if node.getName() != '__init__.py'
],
***************
*** 560,564 ****
# Write out references to subdirectories
#
! directories = packageTreeNode.getSubNodes('application/x-directory')
#directories = [ d for d in directories
# if d[1].items()
--- 493,497 ----
# Write out references to subdirectories
#
! directories = packageTreeNode.getSubNodes(['application/x-directory'])
#directories = [ d for d in directories
# if d[1].items()
***************
*** 1050,1054 ****
"""
#class_names = self._filterNames(packageTreeNode.module_info.getClassNames())
! classes = packageTreeNode.getSubNodes('application/x-class')
class_map = {}
for c in classes:
--- 983,987 ----
"""
#class_names = self._filterNames(packageTreeNode.module_info.getClassNames())
! classes = packageTreeNode.getSubNodes(['application/x-class'])
class_map = {}
for c in classes:
|