[Happydoc-checkins] CVS: HappyDoc3/happydoclib/docset base.py,1.8,1.9
Brought to you by:
doughellmann,
krlosaqp
From: Doug H. <dou...@us...> - 2002-12-15 17:02:17
|
Update of /cvsroot/happydoc/HappyDoc3/happydoclib/docset In directory sc8-pr-cvs1:/tmp/cvs-serv1437/happydoclib/docset Modified Files: base.py Log Message: Use a pseudo-mimetype for dealing with directories. This prevents us from assuming that anything with an unknown mimetype is a directory. Include the title and subtitle in output files. Index: base.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc3/happydoclib/docset/base.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** base.py 8 Dec 2002 17:02:37 -0000 1.8 --- base.py 15 Dec 2002 17:02:14 -0000 1.9 *************** *** 61,64 **** --- 61,65 ---- # import happydoclib + from happydoclib.utils import * from happydoclib.trace import trace from happydoclib.docstring import getConverterFactoryForFile, getConverterFactory *************** *** 68,78 **** # - def isSomethingThatLooksLikeDirectory(path): - return (os.path.isdir(path) - or - os.path.islink(path) - or - os.path.ismount(path) - ) class DocSet: --- 69,72 ---- *************** *** 174,177 **** --- 168,172 ---- mimetype_writer_mapping = { + 'application/x-directory' : 'writeDirectory', 'text/x-python' : 'writePythonFile', 'text/plain' : 'writePlainTextFile', *************** *** 261,291 **** ) ! if packageTreeNode.values(): ! # ! # Directory node ! # ! self.writeDirectory(packageTreeNode) else: # ! # Anything past here looks like a file. # ! mimetype, encoding = packageTreeNode.getMimeType() ! ! writer_name = self.mimetype_writer_mapping.get(mimetype) ! if writer_name: ! writer = getattr(self, writer_name) ! writer(packageTreeNode) ! ! else: ! # ! # Unrecognized file, skipped. ! # ! node_path = packageTreeNode.getPath() ! filename = apply(os.path.join, node_path) ! self.statusMessage('Skiping unrecognized file %s with mimetype %s' % ( ! filename, ! mimetype, ! )) trace.outof() --- 256,276 ---- ) ! mimetype, encoding = packageTreeNode.getMimeType() ! ! writer_name = self.mimetype_writer_mapping.get(mimetype) ! if writer_name: ! writer = getattr(self, writer_name) ! writer(packageTreeNode) else: # ! # Unrecognized file, skipped. # ! node_path = packageTreeNode.getPath() ! filename = apply(os.path.join, node_path) ! self.statusMessage('Skiping unrecognized file %s with mimetype %s' % ( ! filename, ! mimetype, ! )) trace.outof() *************** *** 314,318 **** output_filename = self.getOutputFilenameForPackageTreeNode(packageTreeNode) output_dirname = os.path.dirname(output_filename) ! self.statusMessage('Directory : "%s"\n to: "%s"' % ( canonical_filename, --- 299,303 ---- output_filename = self.getOutputFilenameForPackageTreeNode(packageTreeNode) output_dirname = os.path.dirname(output_filename) ! self.statusMessage('Directory : "%s"\n to: "%s"' % ( canonical_filename, *************** *** 423,427 **** cooked_body = converter.convert(raw_body, 'html', level=3) ! output_file = self.openOutput(output_filename) output_file.write(cooked_body) --- 408,416 ---- cooked_body = converter.convert(raw_body, 'html', level=3) ! output_file = self.openOutput( ! output_filename, ! title=self.title, ! subtitle=packageTreeNode.getRelativeFilename(), ! ) output_file.write(cooked_body) |