Thread: [Happydoc-checkins] CVS: HappyDoc3/happydoclib appclass.py,1.12,1.13
Brought to you by:
doughellmann,
krlosaqp
From: Doug H. <dou...@us...> - 2003-01-19 22:25:10
|
Update of /cvsroot/happydoc/HappyDoc3/happydoclib In directory sc8-pr-cvs1:/tmp/cvs-serv21618/happydoclib Modified Files: appclass.py Log Message: Clean up docstrings. Update options to support specifying a template name, in anticipation on the TAL docset. Implement feature request #6688613. Index: appclass.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc3/happydoclib/appclass.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** appclass.py 18 Jan 2003 19:56:00 -0000 1.12 --- appclass.py 19 Jan 2003 22:25:06 -0000 1.13 *************** *** 112,115 **** --- 112,120 ---- supported_docset_types = happydoclib.docset.DocSetLoader() + # + # Which template should be used? + # + template_name = None + ## ## Local methods *************** *** 227,230 **** --- 232,238 ---- For example:: + + --mimetype stx=text/x-structured + --mimetype .gif=image/gif """ *************** *** 258,262 **** Defaults to ignore:: ! CVS, dist, build, doc, docs. """ --- 266,271 ---- Defaults to ignore:: ! ^(CVS|dist|build|docs?|.*pyc|.*~|tmp)$ ! trace.txt """ *************** *** 291,295 **** ## return ! def optionHandler_t(self, title): "Specify a title for the documentation set." self.docset_title = title --- 300,304 ---- ## return ! def optionHandler_title(self, title): "Specify a title for the documentation set." self.docset_title = title *************** *** 299,306 **** """Specify the documentation set type. ! Defaults to 'multifile_docset'.""" self.set_docset_type(docset_type) return ## ## Main --- 308,326 ---- """Specify the documentation set type. ! Defaults to 'MultiHTMLFile'.""" self.set_docset_type(docset_type) return + def optionHandler_t(self, template_name): + """The name of the template set. + + The value is expected to correspond to the name of a directory + containing a template set. If the path exists, it will be + used. If it does not exist, HappyDoc will look for a + directory with the same name in 'happydoclib/templates'. + """ + self.template_name = template_name + return + ## ## Main *************** *** 344,347 **** --- 364,369 ---- parsed_args = self.getParameterGroupsFromArguments(args) (args, parser_params, docset_params) = parsed_args + if self.template_name: + docset_params['template_name'] = self.template_name self.parser_params = parser_params *************** *** 365,371 **** normcase = normcase[:-1] input_modules.append(normcase) - # # Create the scanner, and get the package trees. # --- 387,439 ---- normcase = normcase[:-1] input_modules.append(normcase) # + # Dump some basic info about what we are going to do. + # + self.statusMessage(verboseLevel=2) + self.statusMessage('Docset Title: %s' % self.docset_title, + verboseLevel=2) + + self.statusMessage(verboseLevel=2) + self.statusMessage('Inputs:', + verboseLevel=2) + self.statusMessage(verboseLevel=2) + for input_module in input_modules: + if input_module == os.curdir: + input_module = os.getcwd() + self.statusMessage(' %s' % input_module, + verboseLevel=2) + + self.statusMessage(verboseLevel=2) + self.statusMessage('Ignoring:', verboseLevel=2) + self.statusMessage(verboseLevel=2) + for ignore_pattern in self._ignore_dir_patterns: + self.statusMessage(' %s' % ignore_pattern, + verboseLevel=2) + + self.statusMessage(verboseLevel=2) + self.statusMessage('Parameters:', verboseLevel=2) + self.statusMessage(verboseLevel=2) + if self.include_comments: + self.statusMessage(' Including comments', + verboseLevel=2) + if self.include_private_names: + self.statusMessage(' Including private symbol names', + verboseLevel=2) + extra_params = docset_params.items() + extra_params.sort() + for name, value in extra_params: + self.statusMessage(' %s=%s' % (name, value), + verboseLevel=2) + + self.statusMessage(verboseLevel=2) + self.statusMessage('Output Directory:', verboseLevel=2) + self.statusMessage(verboseLevel=2) + self.statusMessage(' %s' % self.output_directory, + verboseLevel=2) + + self.statusMessage(verboseLevel=2) + + # # Create the scanner, and get the package trees. # *************** *** 398,477 **** return - - def old_main(self, *args): - - self.statusMessage('%s version %s' % (self._app_name, - self._app_version)) - - # - # Debug info about where the docsets and formatters come from - # - self.statusMessage('Docstring converters from %s' % \ - happydoclib.docstring.__path__[0], 1) - self.statusMessage('Docsets list from %s' % \ - happydoclib.docset.__path__[0], 1) - self.statusMessage('Formatters from %s' % \ - happydoclib.formatter.__path__[0], 1) - - # - # Get the list of modules to input - # - if not args: - # - # No files specified, print a help message and exit. - # - self.showHelp('Specify input file(s) to be processed.') - raise self.HelpRequested, 'No input file(s) specified.' - else: - input_modules = [] - for input_module_name in args: - input_modules.append(os.path.normcase(input_module_name)) - - # - # Create output directory - # - if not self.output: - od = self.output_directory - self.statusMessage('Output directory is %s' % self.output_directory, 2) - if (od[0] != '/'): - od = happydoclib.path.join( happydoclib.path.cwd(), od ) - self.statusMessage('Setting output directory to %s' % od, 2) - od = happydoclib.path.normpath(od) - self.statusMessage('Creating output directory %s' % od, 2) - happydoclib.path.rmkdir(od) - self.output_directory = od - - # - # Create the docset - # - ## docset_init_params = { - - ## 'formatterFactory':self.formatter_factory, - ## 'parserFunc':self.parser_function, - ## 'defaultParserConfigValues':parser_params, - ## 'inputModuleNames':input_modules, - - ## 'author':self.author_name, - ## 'outputBaseDirectory':self.output_directory, - ## 'descriptionFilename':self.package_description_file, - ## 'formatterParameters':formatter_params, - ## 'ignoreDirFunc':self.ignoreDirectoryTest, - ## 'includeComments':self.include_comments, - ## 'includePrivateNames':self.include_private_names, - ## 'statusMessageFunc':self.statusMessage, - ## 'title':self.docset_title, - ## 'useRecursion':self.recurse_into_subdirs, - - ## } - ## docset_init_params.update(docset_params) - ## parsed_modules = apply( self.docset_factory, (), docset_init_params) - ## # - ## # Tell the docset to output its results - ## # - ## parsed_modules.write() - ## # - ## # Clean up - ## # - ## parsed_modules = None - return - --- 466,467 ---- |