From: Doug H. <dou...@us...> - 2002-08-04 12:05:09
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib/docset In directory usw-pr-cvs1:/tmp/cvs-serv28348/happydoclib/docset Modified Files: docset_MultipleFile.py Log Message: Do not call the formatter directly, use our own method to get the output name for an object. Move getFullOutputNameForObject() to DocSet from here. Index: docset_MultipleFile.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/docset/docset_MultipleFile.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** docset_MultipleFile.py 9 Dec 2001 15:36:33 -0000 1.5 --- docset_MultipleFile.py 4 Aug 2002 12:05:06 -0000 1.6 *************** *** 97,104 **** """ - def getFullOutputNameForObject(self, infoObject=None): - "Returns the output destination for documentation about this object." - return self._formatter.getFullOutputNameForObject(None) - def write(self): "Write the documentation set to the output." --- 97,100 ---- *************** *** 107,111 **** # Get the name of and open the docset root file # ! self._root_name = self._formatter.getFullOutputNameForObject(None) self._root_node = self.openOutput( self._root_name, self._title, '' ) # --- 103,107 ---- # Get the name of and open the docset root file # ! self._root_name = self.getFullOutputNameForObject(None) self._root_node = self.openOutput( self._root_name, self._title, '' ) # *************** *** 478,482 **** "Output the documentation for the module named." module = self._all_modules[module_name] ! output_name = self._formatter.getFullOutputNameForObject(module) output = self.openOutput(output_name, 'Module: %s' % module_name, --- 474,478 ---- "Output the documentation for the module named." module = self._all_modules[module_name] ! output_name = self.getFullOutputNameForObject(module) output = self.openOutput(output_name, 'Module: %s' % module_name, *************** *** 536,540 **** for class_name in class_names: c = module.getClassInfo(class_name) ! class_output_name = formatter.getFullOutputNameForObject(c) self._describeClassInModuleNode(output, class_output_name , c) class_output = self.openOutput(class_output_name, --- 532,536 ---- for class_name in class_names: c = module.getClassInfo(class_name) ! class_output_name = self.getFullOutputNameForObject(c) self._describeClassInModuleNode(output, class_output_name , c) class_output = self.openOutput(class_output_name, *************** *** 787,791 **** def testIgnorePackageReadme(self): ! filename = 'TestCases/test_package_summaries/FromReadmeTxt' import happydoclib.formatter.formatter_Null import happydoclib.parseinfo --- 783,787 ---- def testIgnorePackageReadme(self): ! filename = os.path.join('TestCases', 'test_package_summaries', 'FromReadmeTxt') import happydoclib.formatter.formatter_Null import happydoclib.parseinfo *************** *** 805,806 **** --- 801,853 ---- + def testModuleOutputFileCalculation(self): + filename = os.path.join('TestCases', 'test.py') + import happydoclib.formatter.formatter_Null + import happydoclib.parseinfo + docset = MultiFileDocSet( + formatterFactory=happydoclib.formatter.formatter_Null.NullFormatter, + parserFunc=happydoclib.parseinfo.getDocs, + defaultParserConfigValues={'docStringFormat':'StructuredText'}, + inputModuleNames=[ filename ], + outputBaseDirectory=self.output_dir, + descriptionFilename='-', + #descriptionFilename='README.txt', + ) + info_obj = docset[0] + actual_output_name = docset.getFullOutputNameForObject(info_obj) + expected_output_name = os.path.join(self.output_dir, + 'TestCases', + 'test.py.html') + self.failUnlessEqual( + actual_output_name, expected_output_name, + 'Outputs do not match:\n %s\nvs.\n %s' % (actual_output_name, + expected_output_name, + ) + ) + return + + def testPackageOutputFileCalculation(self): + filename = os.path.join('TestCases', 'test.py') + import happydoclib.formatter.formatter_Null + import happydoclib.parseinfo + docset = MultiFileDocSet( + formatterFactory=happydoclib.formatter.formatter_Null.NullFormatter, + parserFunc=happydoclib.parseinfo.getDocs, + defaultParserConfigValues={'docStringFormat':'StructuredText'}, + inputModuleNames=[ filename ], + outputBaseDirectory=self.output_dir, + descriptionFilename='-', + #descriptionFilename='README.txt', + ) + info_obj = None + actual_output_name = docset.getFullOutputNameForObject(info_obj) + expected_output_name = os.path.join(self.output_dir, 'index.html') + self.failUnlessEqual( + actual_output_name, expected_output_name, + 'Outputs do not match:\n %s\nvs.\n %s' % (actual_output_name, + expected_output_name, + ) + ) + return + + |