[Happydoc-checkins] CVS: HappyDoc3/happydoclib appclass.py,1.6,1.7
Brought to you by:
doughellmann,
krlosaqp
From: Doug H. <dou...@us...> - 2002-12-01 22:34:52
|
Update of /cvsroot/happydoc/HappyDoc3/happydoclib In directory sc8-pr-cvs1:/tmp/cvs-serv27141/happydoclib Modified Files: appclass.py Log Message: Comment out some option handlers that might be useful but which aren't supported right now. Move parsing code into scanner module. Index: appclass.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc3/happydoclib/appclass.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** appclass.py 18 Nov 2002 13:41:12 -0000 1.6 --- appclass.py 1 Dec 2002 22:34:49 -0000 1.7 *************** *** 67,70 **** --- 67,71 ---- import happydoclib from happydoclib.scanner import Scanner + from happydoclib import status from happydoclib.trace import trace *************** *** 96,100 **** app_home = 'http://HappyDoc.sourceforge.net/' package_description_file = 'README.txt' - recurse_into_subdirs=True docset_type = None --- 97,100 ---- *************** *** 116,119 **** --- 116,121 ---- def appInit(self): + status.registerStatusMessageFunc(self.statusMessage) + self._app_name = self.__class__.__name__ self._app_version = happydoclib.cvsProductVersion() *************** *** 196,205 **** ## ! def optionHandler_author(self, authorNameAndEmail): ! """Specify the author identification to be inserted for ! references. ! """ ! self.author_name = authorNameAndEmail ! return def optionHandler_d(self, outputDirectory): --- 198,207 ---- ## ! ## def optionHandler_author(self, authorNameAndEmail): ! ## """Specify the author identification to be inserted for ! ## references. ! ## """ ! ## self.author_name = authorNameAndEmail ! ## return def optionHandler_d(self, outputDirectory): *************** *** 210,219 **** return ! def optionHandler_dia(self): ! """Generate UML diagram in Gnome dia format. ! """ ! self.set_docset_type("Dia") ! self.set_format("Dia") ! return def optionHandler_i(self, ignoreDirectory): --- 212,221 ---- return ! ## def optionHandler_dia(self): ! ## """Generate UML diagram in Gnome dia format. ! ## """ ! ## self.set_docset_type("Dia") ! ## self.set_format("Dia") ! ## return def optionHandler_i(self, ignoreDirectory): *************** *** 238,242 **** a __doc__ string. """ ! self.include_comments = False return --- 240,244 ---- a __doc__ string. """ ! happydoclib.parseinfo.setOption(include_comments=0) return *************** *** 246,267 **** return ! def optionHandler_o(self): ! "Specify that output should go to stdout." ! self.set_docset_type('StdOut') ! return ! def optionHandler_p(self, packageDescriptionFile): ! """Specify a file with a description of the package. ! The default packageDescriptionFile is README.txt. ! """ ! self.package_description_file = packageDescriptionFile ! return - def optionHandler_r(self): - "Disable recursion into subdirectories." - self.recurse_into_subdirs = False - return - def optionHandler_t(self, title): "Specify a title for the documentation set." --- 248,264 ---- return ! ## def optionHandler_o(self): ! ## "Specify that output should go to stdout." ! ## self.set_docset_type('StdOut') ! ## return ! ## def optionHandler_p(self, packageDescriptionFile): ! ## """Specify a file with a description of the package. ! ## The default packageDescriptionFile is README.txt. ! ## """ ! ## self.package_description_file = packageDescriptionFile ! ## return def optionHandler_t(self, title): "Specify a title for the documentation set." *************** *** 280,392 **** ## - def scanForInput(self, inputModules): - scanner = Scanner(inputModules, self._ignore_dir_patterns) - return scanner - - def parsePythonInput(self, packageTreeNode): - trace.into('HappyDoc', 'parsePythonInput', - packageTreeNode=packageTreeNode, - ) - # - # Derive the filename for this module. - # - node_path = packageTreeNode.getPath(1) - filename = apply(os.path.join, node_path) - trace.writeVar(filename=filename) - - self.statusMessage('Parsing: %s' % filename) - - # - # Figure out if there is a parent node for the - # documentation suite. - # - package_parent = packageTreeNode.getParent() - if package_parent and hasattr(package_parent, 'module_info'): - docs_parent = package_parent.module_info - else: - docs_parent = None - - trace.writeVar(docs_parent=docs_parent) - - docs = happydoclib.parseinfo.getDocs( - parent=docs_parent, - fileName=filename, - includeComments=self.include_comments, - defaultConfigValues=self.parser_params, - ) - - packageTreeNode.module_info = docs - - trace.outof() - return - - def parsePlainTextInput(self, packageTreeNode): - trace.into('HappyDoc', 'parsePlainTextInput', - packageTreeNode=packageTreeNode, - ) - # - # Derive the filename for this module. - # - node_path = packageTreeNode.getPath(1) - filename = apply(os.path.join, node_path) - trace.writeVar(filename=filename) - - self.statusMessage('Importing preformatted file: %s' % filename) - - #f = open(filename, 'rt') - #body = f.read() - #f.close() - - #packageTreeNode.preformatted_text = body - - trace.outof() - return - - def parseInputCB(self, packageTreeNode): - trace.into('HappyDoc', 'parseInputCB', - packageTreeNode=packageTreeNode, - ) - - node_name = packageTreeNode.getName() - - extension = os.path.splitext(node_name)[1] - - if extension == '.py': - # - # Filename ends in .py, so it is a Python file. - # - self.parsePythonInput(packageTreeNode) - - elif extension in ('.txt', '.stx'): - # - # Filename ends in .txt or .stx so it is - # a text file. - # - self.parsePlainTextInput(packageTreeNode) - - elif packageTreeNode.values(): - # - # Directory node. - # - pass - - elif not packageTreeNode.values(): - # - # Leaf node we are skipping. - # - node_path = packageTreeNode.getPath() - filename = apply(os.path.join, node_path) - self.statusMessage('Skipping: %s' % filename) - - trace.outof() - return - - def parseInputs(self, scanner): - package_trees = scanner.getPackageTrees() - - for package_tree in package_trees: - package_tree.walk(self.parseInputCB) - - return def getParameterGroupsFromArguments(self, args): --- 277,280 ---- *************** *** 452,461 **** # Create the scanner, and get the package trees. # ! scanner = self.scanForInput(input_modules) ! ! # ! # Parse the input files ! # ! self.parseInputs(scanner) # --- 340,349 ---- # Create the scanner, and get the package trees. # ! self.statusMessage('Scanning...') ! scanner = Scanner(inputDirectories=input_modules, ! ignorePatterns=self._ignore_dir_patterns, ! includeComments=self.include_comments, ! ) ! self.statusMessage('Done') # *************** *** 464,468 **** docset = self.docset_factory( scanner=scanner, ! title='Title', outputDirectory=self.output_directory, includeComments=self.include_comments, --- 352,356 ---- docset = self.docset_factory( scanner=scanner, ! title=self.docset_title, outputDirectory=self.output_directory, includeComments=self.include_comments, *************** *** 475,479 **** --- 363,369 ---- # Generate some output # + self.statusMessage('Writing...') docset.write() + self.statusMessage('Done') return |