happydoc-checkins Mailing List for HappyDoc (Page 12)
Brought to you by:
doughellmann,
krlosaqp
You can subscribe to this list here.
2002 |
Jan
(3) |
Feb
(40) |
Mar
(1) |
Apr
|
May
(12) |
Jun
(4) |
Jul
|
Aug
(39) |
Sep
|
Oct
(4) |
Nov
(49) |
Dec
(78) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(54) |
Feb
|
Mar
(41) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(13) |
From: Doug H. <dou...@us...> - 2002-08-04 12:04:18
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib In directory usw-pr-cvs1:/tmp/cvs-serv28167/happydoclib Modified Files: trace.py Log Message: Corrected instructions for enabling trace. Index: trace.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/trace.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** trace.py 12 May 2002 20:19:01 -0000 1.5 --- trace.py 4 Aug 2002 12:04:16 -0000 1.6 *************** *** 35,39 **** function. ! The debug level is set via the environment variable 'TRACE_LEVEL'. Level '0' or no value specified results in no output. Positive integer values are used to control the verbosity of the output with --- 35,39 ---- function. ! The debug level is set via the environment variable 'HAPPYDOC_TRACE'. Level '0' or no value specified results in no output. Positive integer values are used to control the verbosity of the output with |
From: Doug H. <dou...@us...> - 2002-08-04 12:04:01
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib In directory usw-pr-cvs1:/tmp/cvs-serv28071/happydoclib Modified Files: happydocset.py Log Message: Added trace code. Moved getFullOutputNameForObject() here from MultiFileDocSet. Index: happydocset.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/happydocset.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** happydocset.py 10 Feb 2002 13:25:49 -0000 1.8 --- happydocset.py 4 Aug 2002 12:03:58 -0000 1.9 *************** *** 352,355 **** --- 352,363 ---- + def getFullOutputNameForObject(self, infoObject=None): + "Returns the output destination for documentation about this object." + happydoclib.TRACE.into('DocSet', 'getFullOutputNameForObject', + infoObject=infoObject) + output_name = self._formatter.getFullOutputNameForObject(infoObject) + happydoclib.TRACE.outof(output_name) + return output_name + ## ## External documents *************** *** 578,586 **** def getFileInfo(self, fileName): "Parse the file and return the parseinfo instance for it." self.statusMessage('Getting info for %s' % fileName) ! return self._parser_func( fileName, self._include_comments, self._default_parser_config_values, ) def lookForPrewrittenFiles(self, dirName): --- 586,599 ---- def getFileInfo(self, fileName): "Parse the file and return the parseinfo instance for it." + happydoclib.TRACE.into('DocSet', 'getFileInfo', + fileName=fileName, + ) self.statusMessage('Getting info for %s' % fileName) ! info = self._parser_func( fileName, self._include_comments, self._default_parser_config_values, ) + happydoclib.TRACE.outof(info) + return info def lookForPrewrittenFiles(self, dirName): *************** *** 692,695 **** --- 705,709 ---- moduleFileName(file_name) ): + happydoclib.TRACE.write('regular module file') # # Record that we paid attention to this file |
From: Doug H. <dou...@us...> - 2002-08-04 10:48:24
|
Update of /cvsroot/happydoc/HappyDoc In directory usw-pr-cvs1:/tmp/cvs-serv12653 Modified Files: .cvsignore Log Message: Ignore my release announcment notes file. Index: .cvsignore =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/.cvsignore,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** .cvsignore 24 Oct 2001 21:27:34 -0000 1.11 --- .cvsignore 4 Aug 2002 10:48:21 -0000 1.12 *************** *** 26,27 **** --- 26,28 ---- tmp.dps notes.txt + announce_notes.txt \ No newline at end of file |
From: Doug H. <dou...@us...> - 2002-08-04 10:48:00
|
Update of /cvsroot/happydoc/HappyDoc In directory usw-pr-cvs1:/tmp/cvs-serv12559 Modified Files: test_happydoc.py Log Message: Provide defaults to constructor arguments. Index: test_happydoc.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/test_happydoc.py,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** test_happydoc.py 8 Jun 2002 16:59:25 -0000 1.85 --- test_happydoc.py 4 Aug 2002 10:47:57 -0000 1.86 *************** *** 105,108 **** --- 105,113 ---- WEB_CHECKER = os.path.join(WEB_CHECKER_DIR, 'webchecker.py') + def __init__(self, methodName='runTest', outputDir=DEFAULT_OUTPUT_DIR, + statusMessageFunc=None): + StreamFlushTest.__init__(self, methodName, outputDir, statusMessageFunc) + return + def setUp(self): self.happydoc = os.path.join(os.curdir, 'happydoc') *************** *** 380,383 **** --- 385,389 ---- def __init__(self, + methodName='runTest', workingDir=os.curdir, outputDir='DefaultTestOutputDir', *************** *** 389,392 **** --- 395,399 ---- output_dir = happydoclib.path.join(os.pardir, 'HappyDoc', outputDir) nargs['outputDir'] = output_dir + nargs['methodName'] = methodName apply(HappyDocTestBase.__init__, (self,), nargs) # *************** *** 526,530 **** """ ! def __init__(self, outputDir, statusMessageFunc, knownTestCaseClasses): self.output_dir = outputDir self.status_message_func = statusMessageFunc --- 533,537 ---- """ ! def __init__(self, outputDir='', statusMessageFunc=None, knownTestCaseClasses=[]): self.output_dir = outputDir self.status_message_func = statusMessageFunc |
From: Doug H. <dou...@us...> - 2002-08-04 10:47:33
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib/formatter In directory usw-pr-cvs1:/tmp/cvs-serv12501/happydoclib/formatter Modified Files: openoffice.py Log Message: Provide a default for the output directory for tests. Index: openoffice.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/formatter/openoffice.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** openoffice.py 24 Oct 2001 21:27:35 -0000 1.1 --- openoffice.py 4 Aug 2002 10:47:30 -0000 1.2 *************** *** 326,330 **** class OpenOfficeUnitTest(StreamFlushTest): ! def __init__(self, methodName, outputDir): StreamFlushTest.__init__(self, methodName, outputDir) return --- 326,330 ---- class OpenOfficeUnitTest(StreamFlushTest): ! def __init__(self, methodName, outputDir=''): StreamFlushTest.__init__(self, methodName, outputDir) return |
From: Doug H. <dou...@us...> - 2002-08-04 10:47:33
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib In directory usw-pr-cvs1:/tmp/cvs-serv12501/happydoclib Modified Files: happydocstring.py Log Message: Provide a default for the output directory for tests. Index: happydocstring.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/happydocstring.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** happydocstring.py 10 Feb 2002 13:06:00 -0000 1.2 --- happydocstring.py 4 Aug 2002 10:47:30 -0000 1.3 *************** *** 185,188 **** --- 185,195 ---- class DocStringConverterTest(StreamFlushTest): + def __init__(self, methodName, outputDir=''): + StreamFlushTest.__init__(self, methodName, outputDir) + + import happydoclib.docstring + self._hddocstring = happydoclib.docstring + return + def _testConversion(self, inputText, inputFormat, outputFormat, expectedText, errorMessage, *************** *** 208,218 **** quoted_text = converter.quote(inputText, 'html' ) assert (quoted_text == expectedText), errorMessage - return - - def __init__(self, methodName, outputDir): - StreamFlushTest.__init__(self, methodName, outputDir) - - import happydoclib.docstring - self._hddocstring = happydoclib.docstring return --- 215,218 ---- |
From: Doug H. <dou...@us...> - 2002-08-04 10:47:13
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib In directory usw-pr-cvs1:/tmp/cvs-serv12410/happydoclib Modified Files: StreamFlushTest.py Log Message: Only capture stdout and stderr if we've been given the name of a directory to receive the files. Index: StreamFlushTest.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/StreamFlushTest.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** StreamFlushTest.py 12 May 2002 20:17:06 -0000 1.4 --- StreamFlushTest.py 4 Aug 2002 10:47:06 -0000 1.5 *************** *** 137,151 **** try: unittest.TestCase.__call__(self, result) ! except: self.popStreams() ! raise ! self.popStreams() ! sys.stdout.flush() ! sys.stderr.flush() return def pushStreams(self): "Substitute files for the sys streams" ! if verboseLevel < 2: output_dir = os.path.join(self.output_dir, self.name) self.saved_sys_stdout = sys.stdout --- 137,149 ---- try: unittest.TestCase.__call__(self, result) ! finally: self.popStreams() ! sys.stdout.flush() ! sys.stderr.flush() return def pushStreams(self): "Substitute files for the sys streams" ! if verboseLevel < 2 and self.output_dir: output_dir = os.path.join(self.output_dir, self.name) self.saved_sys_stdout = sys.stdout *************** *** 160,164 **** def popStreams(self): "Replace the real sys streams" ! if verboseLevel < 2: sys.stdout.close() sys.stderr.close() --- 158,162 ---- def popStreams(self): "Replace the real sys streams" ! if verboseLevel < 2 and self.output_dir: sys.stdout.close() sys.stderr.close() |
From: Doug H. <dou...@us...> - 2002-06-28 11:27:23
|
Update of /cvsroot/happydoc/HappyDoc In directory usw-pr-cvs1:/tmp/cvs-serv6571 Modified Files: README.txt Log Message: Added reference to ZOD as a user of the happydoclib. Index: README.txt =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/README.txt,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** README.txt 5 Feb 2002 16:02:07 -0000 1.47 --- README.txt 28 Jun 2002 11:27:19 -0000 1.48 *************** *** 272,275 **** --- 272,282 ---- other earth-based systems. + - **ZOD** + + The "Zope Online + Documentation":http://demo.iuveno-net.de/iuveno/Products/ZOnlineDocu + tools use the HappyDoc parsing engine to extract information about + source code. + Bugs |
From: Doug H. <dou...@us...> - 2002-06-08 17:00:11
|
Update of /cvsroot/happydoc/HappyDoc/misc In directory usw-pr-cvs1:/tmp/cvs-serv509/misc Modified Files: guitest_happydoc.py Log Message: Updated to work with new test_happydoc. Index: guitest_happydoc.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/misc/guitest_happydoc.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** guitest_happydoc.py 24 Oct 2001 21:27:36 -0000 1.1 --- guitest_happydoc.py 8 Jun 2002 17:00:08 -0000 1.2 *************** *** 3,7 **** # $Id$ # ! # Time-stamp: <01/03/11 12:20:43 dhellmann> # # Copyright 2001 Doug Hellmann. --- 3,7 ---- # $Id$ # ! # Time-stamp: <02/06/08 12:59:49 dhellmann> # # Copyright 2001 Doug Hellmann. *************** *** 38,43 **** 'module_name' : '$RCSfile$', 'rcs_id' : '$Id$', ! 'creator' : 'Doug Hellmann <Dou...@bi...>', ! 'project' : 'UNSPECIFIED', 'created' : 'Sun, 25-Feb-2001 18:01:35 EST', --- 38,43 ---- 'module_name' : '$RCSfile$', 'rcs_id' : '$Id$', ! 'creator' : 'Doug Hellmann <do...@he...>', ! 'project' : 'HappyDoc', 'created' : 'Sun, 25-Feb-2001 18:01:35 EST', *************** *** 53,69 **** # Import system modules # from Tkinter import * - import sys ! sys.path.append('../PmwContribD') ! sys.path.append('../../Python') ! ! import Pmw # # Import Local modules # ! from GuiAppD import GuiAppD from PipeOutputWindow import PipeOutputWindow import test_happydoc --- 53,67 ---- # Import system modules # + import Pmw from Tkinter import * import sys ! import unittest # # Import Local modules # ! from PmwContribD.GuiAppD import GuiAppD from PipeOutputWindow import PipeOutputWindow + sys.path.append('.') import test_happydoc *************** *** 104,108 **** def runTest(self, *ignore): self.busyStart() ! command = './test_happydoc.py -t %s' % self.selected_test.get() self.component('output').startBackgroundPipe(command, self.testDone) --- 102,106 ---- def runTest(self, *ignore): self.busyStart() ! command = './test_happydoc.py %s 2>&1' % self.selected_test.get() self.component('output').startBackgroundPipe(command, self.testDone) *************** *** 117,127 **** return def updateTestList(self): testchooser = self.component('testchooser') reload(test_happydoc) ! test_names = map(lambda x: x[0], test_happydoc.test_definitions) test_names.insert(0, 'all') testchooser.setlist(test_names) ! default_test = test_happydoc.TestCaseDriver._default_test_case self.selected_test.set(default_test) return --- 115,135 ---- return + def getTestNames(self, nameList, testSuite): + for test in testSuite._tests: + try: + nameList.append(test.id()) + except AttributeError: + self.getTestNames(nameList, test) + return + def updateTestList(self): testchooser = self.component('testchooser') reload(test_happydoc) ! test_suite = test_happydoc.getTestSuite() ! test_names = [] ! self.getTestNames(test_names, test_suite) test_names.insert(0, 'all') testchooser.setlist(test_names) ! default_test = 'all' self.selected_test.set(default_test) return |
From: Doug H. <dou...@us...> - 2002-06-08 16:59:28
|
Update of /cvsroot/happydoc/HappyDoc In directory usw-pr-cvs1:/tmp/cvs-serv326 Modified Files: test_happydoc.py Log Message: Structural changes to support GUI test runner. Index: test_happydoc.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/test_happydoc.py,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** test_happydoc.py 13 May 2002 10:47:29 -0000 1.84 --- test_happydoc.py 8 Jun 2002 16:59:25 -0000 1.85 *************** *** 562,566 **** --- 562,663 ---- ]) + + def addAllTests(test_loader, actual_test_suite): + # + # Load tests from modules we know contain tests + # + for m in ( + # + # Supporting tools + # + happydoclib.CommandLineApp, + happydoclib.indentstring, + happydoclib.optiontools, + happydoclib.trace, + happydoclib.path, + + # + # Foundation modules + # + happydoclib.parsecomments, + happydoclib.parseinfo, + happydoclib.happydocstring, + happydoclib.happydocset, + + # + # Docstring converters + # + happydoclib.docstring, + happydoclib.docstring.docstring_ClassicStructuredText, + happydoclib.docstring.docstring_StructuredText, + happydoclib.docstring.docstring_RawText, + happydoclib.docstring.docstring_PlainText, + + # + # Formatters + # + happydoclib.formatter.fileformatterbase, + happydoclib.formatter.openoffice, + happydoclib.formatter.formatter_HTMLFile, + + # + # Docsets + # + happydoclib.docset.docset_MultipleFile + + ): + actual_test_suite.addTest(test_loader.loadTestsFromModule(m)) + # + # Load tests from classes in this module + # + for c in ( ExecuteHappyDocTest, + ExternalTest, + ): + actual_test_suite.addTest(test_loader.loadTestsFromTestCase(c)) + return + + + + def getBugTests(actual_test_suite, output_dir): + bug_ids = map(lambda x:x[18:-3], glob(os.path.join('TestCases', 'test_bug*.py'))) + bug_ids.sort() + for bug in bug_ids: + #test_definitions.append( (bug, HappyDocBugRegressionTest) ) + actual_test_suite.addTest( + HappyDocBugRegressionTest( methodName=bug, + outputDir=output_dir, + ) + ) + return + + def getTestSuite(get_all_tests=1, get_bug_tests=1, output_dir='/dev/null', + progress_callback=None, args=[]): + actual_test_suite = unittest.TestSuite() + + test_loader = HappyDocTestLoader(output_dir, + progress_callback, + (ExecuteHappyDocTest, + ZopeTest, + HappyDocBugRegressionTest, + )) + + if get_all_tests: + addAllTests(test_loader, actual_test_suite) + getBugTests(actual_test_suite, output_dir) + + elif get_bug_tests: + getBugTests(actual_test_suite, output_dir) + elif args: + # Run the tests specified by the user + for a in args: + actual_test_suite.addTest( test_loader.loadTestsFromName(a) ) + else: + # Default to running all tests + get_all_tests = 0 + actual_test_suite.addTest( test_loader.loadTestsFromName('__main__.ExecuteHappyDocTest.testSelfHTML') ) + + return actual_test_suite + class TestCaseDriver(happydoclib.CommandLineApp.CommandLineApp): *************** *** 684,696 **** # Figure out what tests to process # - actual_test_suite = unittest.TestSuite() - - test_loader = HappyDocTestLoader(self._output_dir, - self.statusMessage, - (ExecuteHappyDocTest, - ZopeTest, - HappyDocBugRegressionTest, - )) - get_all_tests = 0 get_bug_tests = 0 --- 781,784 ---- *************** *** 700,784 **** elif 'bugs' in args: get_bug_tests = 1 ! elif args: ! # Run the tests specified by the user ! for a in args: ! actual_test_suite.addTest( test_loader.loadTestsFromName(a) ) ! else: ! # Default to running all tests ! get_all_tests = 0 ! actual_test_suite.addTest( test_loader.loadTestsFromName('__main__.ExecuteHappyDocTest.testSelfHTML') ) ! ! if get_all_tests: ! # ! # Load tests from modules we know contain tests ! # ! for m in ( ! # ! # Supporting tools ! # ! happydoclib.CommandLineApp, ! happydoclib.indentstring, ! happydoclib.optiontools, ! happydoclib.trace, ! happydoclib.path, ! ! # ! # Foundation modules ! # ! happydoclib.parsecomments, ! happydoclib.parseinfo, ! happydoclib.happydocstring, ! happydoclib.happydocset, ! ! # ! # Docstring converters ! # ! happydoclib.docstring, ! happydoclib.docstring.docstring_ClassicStructuredText, ! happydoclib.docstring.docstring_StructuredText, ! happydoclib.docstring.docstring_RawText, ! happydoclib.docstring.docstring_PlainText, ! ! # ! # Formatters ! # ! happydoclib.formatter.fileformatterbase, ! happydoclib.formatter.openoffice, ! happydoclib.formatter.formatter_HTMLFile, ! ! # ! # Docsets ! # ! happydoclib.docset.docset_MultipleFile ! ! ): ! actual_test_suite.addTest(test_loader.loadTestsFromModule(m)) ! # ! # Load tests from classes in this module ! # ! for c in ( ExecuteHappyDocTest, ! ExternalTest, ! ): ! actual_test_suite.addTest(test_loader.loadTestsFromTestCase(c)) ! ! # ! # Check tests related to bug reports # ! if get_all_tests or get_bug_tests: ! bug_ids = map(lambda x:x[18:-3], glob(os.path.join('TestCases', 'test_bug*.py'))) ! bug_ids.sort() ! for bug in bug_ids: ! #test_definitions.append( (bug, HappyDocBugRegressionTest) ) ! actual_test_suite.addTest( ! HappyDocBugRegressionTest( methodName=bug, ! outputDir=self._output_dir, ! ) ! ) ! # ! # Optionally include the Zope tests ! # ! if self._include_zope: ! actual_test_suite.addTest(test_loader.loadTestsFromTestCase(ZopeTest)) # --- 788,803 ---- elif 'bugs' in args: get_bug_tests = 1 ! ! actual_test_suite = getTestSuite(get_all_tests=get_all_tests, ! get_bug_tests=get_bug_tests, ! output_dir=self._output_dir, ! progress_callback=self.statusMessage, ! args=args) ! # ! # Optionally include the Zope tests # ! if self._include_zope: ! actual_test_suite.addTest(test_loader.loadTestsFromTestCase(ZopeTest)) # |
From: Doug H. <dou...@us...> - 2002-06-08 16:59:01
|
Update of /cvsroot/happydoc/HappyDoc In directory usw-pr-cvs1:/tmp/cvs-serv32677 Modified Files: Makefile Log Message: Include method names in TAGS file. Index: Makefile =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/Makefile,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** Makefile 31 Oct 2001 13:15:11 -0000 1.29 --- Makefile 8 Jun 2002 16:58:58 -0000 1.30 *************** *** 74,76 **** tags: ! find . -name '*.py' | xargs etags --- 74,76 ---- tags: ! find . -name '*.py' | etags -l auto --regex='/[ \t]*\def[ \t]+\([^ :(\t]+\)/\1/' - |
From: Doug H. <dou...@us...> - 2002-05-13 10:47:33
|
Update of /cvsroot/happydoc/HappyDoc In directory usw-pr-cvs1:/tmp/cvs-serv30774 Modified Files: test_happydoc.py Log Message: Fixed a problem using webchecker where an output prefix was being used. Changed default to not run webchecker. Each HTML output test turns on the feature if it is appropriate. Added assertion to verify that the test does not report any errors from webchecker. Index: test_happydoc.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/test_happydoc.py,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** test_happydoc.py 12 May 2002 20:16:38 -0000 1.83 --- test_happydoc.py 13 May 2002 10:47:29 -0000 1.84 *************** *** 109,113 **** return ! def runHappyDoc(self, modules=(), extraArgs=(), useWebChecker=WEBCHECKER_AVAILABLE): # # Fix up output directory variable --- 109,113 ---- return ! def runHappyDoc(self, modules=(), extraArgs=(), useWebChecker=0): # # Fix up output directory variable *************** *** 178,185 **** c = webchecker.Checker() c.setflags( checkext=0, verbose=2, nonames=1 ) ! url = os.path.join(output_dir, 'index.html') c.addroot( url ) c.run() c.report() # --- 178,203 ---- c = webchecker.Checker() c.setflags( checkext=0, verbose=2, nonames=1 ) ! ! # ! # Work out the output prefix, if one was specified. This is ! # used to determine the real root filename, since it will ! # also include the prefix value. ! # ! prefix = '' ! for extra_arg in extraArgs: ! try: ! name, value = extra_arg.split('=') ! except ValueError: ! pass ! else: ! if name == 'formatter_filenamePrefix': ! prefix = value ! break ! ! url = os.path.join(output_dir, '%sindex.html' % prefix) c.addroot( url ) c.run() c.report() + assert not c.bad, "Link checker reports errors." # *************** *** 269,273 **** assert (not self.runHappyDoc( (os.path.join('TestCases', 'test.py'),), extraArgs=('-T', 'StdOut'), - useWebChecker=1 ) ), 'HTML to standard-output docset test failed.' --- 287,290 ---- |
From: Doug H. <dou...@us...> - 2002-05-13 01:14:48
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib In directory usw-pr-cvs1:/tmp/cvs-serv10733/happydoclib Modified Files: Tag: dos_path_bug happydocset.py happydom.py path.py Log Message: Initial pass at a fix for the Win32 path problems, including simplifying the definition of the path to the output file for an objects documentation. Index: happydocset.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/happydocset.py,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** happydocset.py 10 Feb 2002 13:25:49 -0000 1.8 --- happydocset.py 13 May 2002 01:14:44 -0000 1.8.2.1 *************** *** 342,345 **** --- 342,353 ---- fully_qualified_name = formatter.getOutputNameForObject(self) happydoclib.TRACE.writeVar(fully_qualified_name=fully_qualified_name) + + extension = '.%s' % formatter.getFilenameExtension() + len_extension = len(extension) + if fully_qualified_name[-len_extension:] == extension: + happydoclib.TRACE.write('fully qualified name has extension') + fully_qualified_name = fully_qualified_name[:-len_extension] + happydoclib.TRACE.writeVar(fully_qualified_name=fully_qualified_name) + root_node_name = formatter.getRootNodeName() my_root_node = happydoclib.path.join(fully_qualified_name, root_node_name) *************** *** 557,560 **** --- 565,569 ---- 'statusMessageFunc':self._status_message_func, 'useRecursion':self._use_recursion, + 'parent':self, } # *************** *** 578,586 **** def getFileInfo(self, fileName): "Parse the file and return the parseinfo instance for it." self.statusMessage('Getting info for %s' % fileName) ! return self._parser_func( fileName, ! self._include_comments, ! self._default_parser_config_values, ! ) def lookForPrewrittenFiles(self, dirName): --- 587,599 ---- def getFileInfo(self, fileName): "Parse the file and return the parseinfo instance for it." + happydoclib.TRACE.into('DocSet', 'getFileInfo', fileName=fileName) self.statusMessage('Getting info for %s' % fileName) ! module_info = self._parser_func( self, ! fileName, ! self._include_comments, ! self._default_parser_config_values, ! ) ! happydoclib.TRACE.outof(module_info) ! return module_info def lookForPrewrittenFiles(self, dirName): *************** *** 832,854 **** class DocsetUnitTest(happydoclib.StreamFlushTest.StreamFlushTest): ! ! def testPackageSummaries(self): ! filename = 'TestCases/test_package_summaries' ! ! basic_expected_package_info = { ! 'FromInit':'Summary from __init__.py', ! 'FromReadme':'Summary from README', ! 'FromReadmeTxt':'Summary from README.txt', ! 'FromTitle':'HappyDoc Generated Documentation (use -t to specify a new title): Nested.FromTitle', ! } ! basic_expected_package_names = basic_expected_package_info.keys() ! ! parent_expected_package_info = {} ! parent_expected_package_info.update(basic_expected_package_info) ! parent_expected_package_info['Nested'] = 'Nested Modules' ! parent_expected_package_info['FromTitle'] = 'HappyDoc Generated Documentation (use -t to specify a new title): FromTitle' ! parent_expected_package_names = parent_expected_package_info.keys() ! ! #module = getDocs(None, filename) import happydoclib.formatter.formatter_Null docset = DocSet( formatterFactory=happydoclib.formatter.formatter_Null.NullFormatter, --- 845,852 ---- class DocsetUnitTest(happydoclib.StreamFlushTest.StreamFlushTest): ! ! def testOutputDirectory(self): ! filename = 'TestCases/test.py' ! test_output_dir = 'c:\\happydoc\\HappyDocTestOut' import happydoclib.formatter.formatter_Null docset = DocSet( formatterFactory=happydoclib.formatter.formatter_Null.NullFormatter, *************** *** 856,892 **** defaultParserConfigValues={'docStringFormat':'StructuredText'}, inputModuleNames=[ filename ], ! outputBaseDirectory=self.output_dir, statusMessageFunc=self.status_message_func, ) ! for m in docset.data: ! name = m.getName() ! assert name in parent_expected_package_names, \ ! 'Unexpected module %s found in docset.' % name ! ! expected_summary = parent_expected_package_info[name] ! ! actual_summary, format = m.getSummaryAndFormat() ! assert actual_summary == expected_summary, \ ! 'Summary values do not match for %s (expected "%s", got "%s")' \ ! % (name, expected_summary, actual_summary) ! ! if name == 'Nested': ! for cm in m.data: ! cname = cm.getName() ! if cname == '__init__': ! continue ! assert cname in basic_expected_package_names, \ ! 'Unexpected child module %s found in child docset.' % cname ! ! cexpected_summary = basic_expected_package_info[cname] ! cactual_summary, format = cm.getSummaryAndFormat() ! assert cactual_summary == cexpected_summary, \ ! 'Summary values do not match for child module %s (expected "%s", got "%s")' \ ! % (cname, cexpected_summary, cactual_summary) ! ! ! return def _privateNameTest(self, includePrivateNames): --- 854,925 ---- defaultParserConfigValues={'docStringFormat':'StructuredText'}, inputModuleNames=[ filename ], ! outputBaseDirectory=test_output_dir, statusMessageFunc=self.status_message_func, ) ! docset_base_dir = docset.getDocsetBaseDirectory() ! assert docset_base_dir == test_output_dir, 'Docset directory %s does not match %s' % \ ! (docset_base_dir, test_output_dir) ! output_base_dir = docset.getOutputBaseDirectory() ! assert docset_base_dir == test_output_dir, 'Output directory %s does not match %s' % \ ! (docset_base_dir, test_output_dir) ! docset_file_name = docset.getFilename() ! assert docset_file_name == test_output_dir, 'File name %s does not match expected %s' % \ ! (docset_file_name, test_output_dir) ! return ! if os.name != 'nt': ! def testPackageSummaries(self): ! filename = 'TestCases/test_package_summaries' ! ! basic_expected_package_info = { ! 'FromInit':'Summary from __init__.py', ! 'FromReadme':'Summary from README', ! 'FromReadmeTxt':'Summary from README.txt', ! 'FromTitle':'HappyDoc Generated Documentation (use -t to specify a new title): Nested.FromTitle', ! } ! basic_expected_package_names = basic_expected_package_info.keys() ! parent_expected_package_info = {} ! parent_expected_package_info.update(basic_expected_package_info) ! parent_expected_package_info['Nested'] = 'Nested Modules' ! parent_expected_package_info['FromTitle'] = 'HappyDoc Generated Documentation (use -t to specify a new title): FromTitle' ! parent_expected_package_names = parent_expected_package_info.keys() ! ! #module = getDocs(None, filename) ! import happydoclib.formatter.formatter_Null ! docset = DocSet( formatterFactory=happydoclib.formatter.formatter_Null.NullFormatter, ! parserFunc=happydoclib.parseinfo.getDocs, ! defaultParserConfigValues={'docStringFormat':'StructuredText'}, ! inputModuleNames=[ filename ], ! outputBaseDirectory=self.output_dir, ! statusMessageFunc=self.status_message_func, ! ) ! for m in docset.data: ! name = m.getName() ! assert name in parent_expected_package_names, \ ! 'Unexpected module %s found in docset.' % name ! ! expected_summary = parent_expected_package_info[name] ! ! actual_summary, format = m.getSummaryAndFormat() ! assert actual_summary == expected_summary, \ ! 'Summary values do not match for %s (expected "%s", got "%s")' \ ! % (name, expected_summary, actual_summary) ! ! if name == 'Nested': ! for cm in m.data: ! cname = cm.getName() ! if cname == '__init__': ! continue ! assert cname in basic_expected_package_names, \ ! 'Unexpected child module %s found in child docset.' % cname ! ! cexpected_summary = basic_expected_package_info[cname] ! ! cactual_summary, format = cm.getSummaryAndFormat() ! assert cactual_summary == cexpected_summary, \ ! 'Summary values do not match for child module %s (expected "%s", got "%s")' \ ! % (cname, cexpected_summary, cactual_summary) ! return def _privateNameTest(self, includePrivateNames): Index: happydom.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/happydom.py,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** happydom.py 11 Nov 2001 18:46:19 -0000 1.4 --- happydom.py 13 May 2002 01:14:44 -0000 1.4.2.1 *************** *** 115,118 **** --- 115,129 ---- return self._parent + def getPath(self): + "Returns a sequence of node names leading to this node." + parent = self.getParent() + if parent: + path = parent.getPath() + else: + path = [] + if self.getName(): + path.append( self.getName() ) + return path + def getFilename(self): "Return the filename from which the object came." *************** *** 134,138 **** happydoclib.TRACE.writeVar(parent_base=parent_base) happydoclib.TRACE.writeVar(parent_ext=parent_ext) ! name = '%s_%s%s' % ( parent_base, self.getName(), parent_ext ) happydoclib.TRACE.outof(name) return name --- 145,154 ---- happydoclib.TRACE.writeVar(parent_base=parent_base) happydoclib.TRACE.writeVar(parent_ext=parent_ext) ! #if parent_ext: ! # my_file = '%s.%s' % (self.getName(), parent_ext) ! #else: ! # my_file = self.getName() ! my_file = self.getFilename() ! name = happydoclib.path.join(parent_base, my_file) happydoclib.TRACE.outof(name) return name Index: path.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/path.py,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** path.py 17 Feb 2002 13:49:49 -0000 1.8 --- path.py 13 May 2002 01:14:44 -0000 1.8.2.1 *************** *** 67,71 **** # Import Local modules # ! from happydoclib.StreamFlushTest import StreamFlushTest # --- 67,74 ---- # Import Local modules # ! from StreamFlushTest import StreamFlushTest ! from trace import trace as TRACE ! ! #TRACE.setVerbosity(3) # *************** *** 97,102 **** def applyPrefixToPath(path, prefix): "Add the prefix value to every part of a given path." parts = string.split( path, os.sep ) ! #print 'PARTS:', parts prefix_len = len(prefix) real_parts = [] --- 100,107 ---- def applyPrefixToPath(path, prefix): "Add the prefix value to every part of a given path." + TRACE.into('PATH', 'applyPrefixToPath', path=path, prefix=prefix) + drive, path = os.path.splitdrive(path) parts = string.split( path, os.sep ) ! TRACE.writeVar(parts=parts) prefix_len = len(prefix) real_parts = [] *************** *** 105,129 **** pass elif p not in ( '.', '..' ) and (p[:prefix_len] != prefix): ! #print 'modifying "%s"' % p p = '%s%s' % (prefix, p) real_parts.append(p) ! #print 'REAL PARTS:', real_parts name = apply(os.path.join, real_parts) ! if path and path[0] == os.sep: name = os.sep + name return name def removePrefix(path, prefix): "Remove prefix from the beginning of path, if present." one_up = os.path.dirname(path) common_prefix = commonPrefix(one_up, prefix) ! #print 'PATH: removePrefix( %s, %s )' % (path, prefix) ! #print 'PATH: common_prefix', common_prefix if common_prefix == prefix: path = path[len(common_prefix):] while path and (path[0] == os.sep): path = path[1:] ! #print 'PATH: result', path return path --- 110,152 ---- pass elif p not in ( '.', '..' ) and (p[:prefix_len] != prefix): ! TRACE.write('modifying "%s"' % p) p = '%s%s' % (prefix, p) real_parts.append(p) ! TRACE.writeVar(real_parts=real_parts) name = apply(os.path.join, real_parts) ! if drive: ! name = os.sep.join((drive, name)) ! elif path and path[0] == os.sep: name = os.sep + name + TRACE.outof(name) return name def removePrefix(path, prefix): "Remove prefix from the beginning of path, if present." + TRACE.into('PATH', 'removePrefix', path=path, prefix=prefix) + + path=os.path.normcase(path) + prefix=os.path.normcase(prefix) + TRACE.writeVar(path_after_norm_case=path) + TRACE.writeVar(prefix_after_norm_case=prefix) + one_up = os.path.dirname(path) + TRACE.writeVar(one_up=one_up) + common_prefix = commonPrefix(one_up, prefix) ! TRACE.writeVar(common_prefix=common_prefix) ! if common_prefix == prefix: path = path[len(common_prefix):] + else: + TRACE.write('common prefix (%s)' % common_prefix) + TRACE.write('does not match specified prefix (%s)' % prefix) + + TRACE.writeVar(pathMinusPrefix=path) while path and (path[0] == os.sep): path = path[1:] ! ! TRACE.outof(path) return path *************** *** 144,162 **** subdirectory name matches. """ ! #print 'commonPrefix(%s, %s)' % (path1, path2) if not path1 or not path2: return '' path1_parts = string.split(path1, os.sep) path2_parts = string.split(path2, os.sep) common = [] for p1, p2 in map(None, path1_parts, path2_parts): ! if p1 == p2: common.append(p1) else: break common = string.join(common, os.sep) ! if path1 and path1[0] == '/' and common and common[0] != '/': ! common = '/' + common ! #print '->"%s"' % common return common --- 167,204 ---- subdirectory name matches. """ ! TRACE.into('PATH', 'commonPrefix', path1=path1, path2=path2) if not path1 or not path2: + TRACE.outof('') + return '' + + drive1, path1 = os.path.splitdrive(path1) + TRACE.writeVar(drive1=drive1) + drive2, path2 = os.path.splitdrive(path2) + TRACE.writeVar(drive2=drive2) + if drive1 != drive2: + TRACE.outof('') return '' + path1_parts = string.split(path1, os.sep) + TRACE.writeVar(path1_parts=path1_parts) path2_parts = string.split(path2, os.sep) + TRACE.writeVar(path2_parts=path2_parts) + common = [] for p1, p2 in map(None, path1_parts, path2_parts): ! if p1 and p1 == p2: ! TRACE.write('Found common part "%s"' % p1) common.append(p1) + elif not p1: + pass else: break common = string.join(common, os.sep) ! if drive1 and common: ! TRACE.write('have a drive spec') ! common = os.path.normcase('%s%s%s' % (drive1, os.sep, common)) ! elif path1 and path1[0] == os.sep and common and common[0] != os.sep: ! common = os.sep + common ! TRACE.outof(common) return common *************** *** 186,194 **** # Find the part of path1 which is *not* part of path1prefix # ! #print 'joinWithCommonMiddle(%s, %s, %s)' % (path1prefix, path1, path2) common_prefix = commonPrefix(path1prefix, path1) ! #print ' common prefix:', common_prefix real_base = removePrefix(path1, common_prefix) ! #print ' real base:', real_base # # Remove the prefix common to the docset_real_base and --- 228,237 ---- # Find the part of path1 which is *not* part of path1prefix # ! TRACE.into('PATH', 'joinWithCommonMiddle', path1prefix=path1prefix, ! path1=path1, path2=path2) common_prefix = commonPrefix(path1prefix, path1) ! TRACE.writeVar(common_prefix=common_prefix) real_base = removePrefix(path1, common_prefix) ! TRACE.writeVar(real_base=real_base) # # Remove the prefix common to the docset_real_base and *************** *** 196,205 **** # common_prefix = commonPrefix(real_base, path2) ! #print ' common prefix with real base and path2:', common_prefix path2 = removePrefix(path2, common_prefix) ! #print ' fixed path2:', path2 name = join( path1, path2 ) ! #print '->"%s"' % name return name --- 239,248 ---- # common_prefix = commonPrefix(real_base, path2) ! TRACE.write('common prefix with real base and path2:', common_prefix) path2 = removePrefix(path2, common_prefix) ! TRACE.write('fixed path2:', path2) name = join( path1, path2 ) ! TRACE.outof(name) return name *************** *** 222,230 **** fromName will point directly to toName. """ ! dbg=0 ! if dbg: print '\nPATH: FROM: ', fromName ! if dbg: print 'PATH: TO : ', toName ! if dbg: print 'PATH: BASE: ', baseDirectory ! # # Normalize directory names --- 265,273 ---- fromName will point directly to toName. """ ! TRACE.into('PATH', 'computeRelativeHTMLLink', ! fromName=fromName, ! toName=toName, ! baseDirectory=baseDirectory, ! ) # # Normalize directory names *************** *** 232,237 **** fromName = os.path.normpath(fromName) toName = os.path.normpath(toName) ! if dbg: print 'PATH: FROM NORMALIZED : ', fromName ! if dbg: print 'PATH: TO NORMALIZED : ', toName # --- 275,280 ---- fromName = os.path.normpath(fromName) toName = os.path.normpath(toName) ! TRACE.writeVar(fromNameNormalized=fromName) ! TRACE.writeVar(toNameNormalized=toName) # *************** *** 240,248 **** fromName = removePrefix(fromName, baseDirectory) toName = removePrefix(toName, baseDirectory) ! if dbg: print 'PATH: FROM - PREFIX : ', fromName ! if dbg: print 'PATH: TO - PREFIX : ', toName if fromName == toName: ! if dbg: print '\tPATH: same name' relative_link = os.path.basename(toName) else: --- 283,291 ---- fromName = removePrefix(fromName, baseDirectory) toName = removePrefix(toName, baseDirectory) ! TRACE.writeVar(fromNameMinusPrefix=fromName) ! TRACE.writeVar(toNameMinusPrefix=toName) if fromName == toName: ! TRACE.writeVar(toName=toName) relative_link = os.path.basename(toName) else: *************** *** 251,260 **** while from_name_no_prefix and (from_name_no_prefix[0] == os.sep): from_name_no_prefix = from_name_no_prefix[1:] ! if dbg: print '\tPATH: from, no prefix:', from_name_no_prefix ! if dbg and from_name_no_prefix == 'z.html': ! raise 'debug' subdir_path = os.path.dirname(from_name_no_prefix) parts = string.split(subdir_path, os.sep) ! if dbg: print '\tPATH: parts:', parts if parts and parts[0]: levels = len(string.split(subdir_path, os.sep)) --- 294,301 ---- while from_name_no_prefix and (from_name_no_prefix[0] == os.sep): from_name_no_prefix = from_name_no_prefix[1:] ! TRACE.writeVar(from_name_no_prefix=from_name_no_prefix) subdir_path = os.path.dirname(from_name_no_prefix) parts = string.split(subdir_path, os.sep) ! TRACE.writeVar(parts=parts) if parts and parts[0]: levels = len(string.split(subdir_path, os.sep)) *************** *** 266,270 **** to_name_no_prefix = to_name_no_prefix[1:] relative_link = "%s%s" % (up_levels, to_name_no_prefix) ! if dbg: print 'PATH: LINK: ', relative_link, '\n' return relative_link --- 307,311 ---- to_name_no_prefix = to_name_no_prefix[1:] relative_link = "%s%s" % (up_levels, to_name_no_prefix) ! TRACE.outof(relative_link) return relative_link *************** *** 305,309 **** def join( *args ): "os.path.join" ! return apply(os.path.join, args) def cwd(): --- 346,353 ---- def join( *args ): "os.path.join" ! TRACE.into('PATH', 'join', args=args) ! result=apply(os.path.join, args) ! TRACE.outof(result) ! return result def cwd(): *************** *** 349,352 **** --- 393,405 ---- % (expected, actual) return + + if os.name == 'nt': + def testApplyPreifxToPathWin32(self): + expected = 'c:\\BLAH_tmp\\BLAH_foo' + actual = applyPrefixToPath('c:\\BLAH_tmp\\BLAH_foo', 'BLAH_') + assert actual == expected, \ + 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ + % (expected, actual) + return def testApplyPrefixToPathEmpty(self): *************** *** 373,376 **** --- 426,438 ---- % (expected, actual) return + + if os.name == 'nt': + def testRemovePrefixWin32(self): + expected = 'foo' + actual = removePrefix('c:\\tmp\\foo', 'c:\\tmp') + assert actual == expected, \ + 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ + % (expected, actual) + return def testRemovePrefixNotThere(self): *************** *** 381,384 **** --- 443,455 ---- % (expected, actual) return + + if os.name == 'nt': + def testRemovePrefixNotThereWin32(self): + expected = 'c:\\tmp\\foo' + actual = removePrefix('c:\\tmp\\foo', 'c:\\blah') + assert actual == expected, \ + 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ + % (expected, actual) + return def testRemovePrefixEmptyPath(self): *************** *** 407,410 **** --- 478,491 ---- return + if os.name == 'nt': + def testCommonPrefixWin32(self): + expected = 'c:\\tmp' + actual = commonPrefix('c:\\tmp\\foo', + 'c:\\tmp\\blah') + assert actual == expected, \ + 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ + % (expected, actual) + return + def testCommonPrefixNone(self): expected = '' *************** *** 417,420 **** --- 498,513 ---- return + if os.name == 'nt': + def testCommonPrefixNoneWin32(self): + expected = '' + actual = commonPrefix('c:\\var\\tmp\\foo', + 'c:\\tmp\\blah', + ) + assert actual == expected, \ + 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ + % (expected, actual) + return + + def testCommonPrefixEmptyPaths(self): expected = '' *************** *** 440,443 **** --- 533,548 ---- % (expected, actual) return + + if os.name == 'nt': + def testJoinWithCommonMiddleWin32(self): + expected = 'c:\\root\\one\\two\\three\\filename.txt' + actual = joinWithCommonMiddle('c:\\root\\one', + 'c:\\root\\one\\two', + 'two\\three\\filename.txt' + ) + assert actual == expected, \ + 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ + % (expected, actual) + return def testJoinWithCommonMiddleNotCommon(self): *************** *** 451,454 **** --- 556,571 ---- % (expected, actual) return + + if os.name == 'nt': + def testJoinWithCommonMiddleNotCommonWin32(self): + expected = 'c:\\%s' % os.path.join('root', 'one', 'four', 'two', 'three', 'filename.txt') + actual = joinWithCommonMiddle('c:\\%s' % os.path.join('root', 'one', 'five'), + 'c:\\%s' % os.path.join('root', 'one', 'four'), + os.path.join('two', 'three', 'filename.txt') + ) + assert actual == expected, \ + 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ + % (expected, actual) + return def testJoinWithCommonMiddleEmptyPrefix(self): *************** *** 462,465 **** --- 579,594 ---- % (expected, actual) return + + if os.name == 'nt': + def testJoinWithCommonMiddleEmptyPrefixWin32(self): + expected = 'c:\\%s' % os.path.join('root', 'one', 'four', 'two', 'three', 'filename.txt') + actual = joinWithCommonMiddle('', + 'c:\\%s' % os.path.join('root', 'one', 'four'), + os.path.join('two', 'three', 'filename.txt') + ) + assert actual == expected, \ + 'Path modification failed.\n\tExpected "%s",\n\tgot "%s"' \ + % (expected, actual) + return def testJoinWithCommonMiddleEmptyPath1(self): *************** *** 543,546 **** if __name__ == '__main__': ! unittest.main() ! --- 672,674 ---- if __name__ == '__main__': ! unittest.main() |
From: Doug H. <dou...@us...> - 2002-05-13 01:14:48
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib/parseinfo In directory usw-pr-cvs1:/tmp/cvs-serv10733/happydoclib/parseinfo Modified Files: Tag: dos_path_bug __init__.py suite.py Log Message: Initial pass at a fix for the Win32 path problems, including simplifying the definition of the path to the output file for an objects documentation. Index: __init__.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/parseinfo/__init__.py,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** __init__.py 5 Feb 2002 01:18:21 -0000 1.6 --- __init__.py 13 May 2002 01:14:44 -0000 1.6.2.1 *************** *** 126,130 **** # ! def getDocs(fileName, includeComments=1, defaultConfigValues={}): """Retrieve information from the parse tree of a source file. --- 126,130 ---- # ! def getDocs(parent, fileName, includeComments=1, defaultConfigValues={}): """Retrieve information from the parse tree of a source file. *************** *** 139,142 **** --- 139,148 ---- """ + happydoclib.TRACE.into('parseinfo', 'getDocs', + parent=parent, + fileName=fileName, + includeComments=includeComments, + defaultConfigValues=defaultConfigValues, + ) f = open(fileName) # *************** *** 172,176 **** else: comment_info = {} ! mod_info = ModuleInfo(parent=None, tree=tup, name=base_filename, --- 178,182 ---- else: comment_info = {} ! mod_info = ModuleInfo(parent=parent, tree=tup, name=base_filename, *************** *** 178,181 **** --- 184,188 ---- commentInfo=comment_info, defaultConfigValues=defaultConfigValues) + happydoclib.TRACE.outof(mod_info) return mod_info *************** *** 210,214 **** comments_flag = self.include_comments.get(name, 1) self.filename = filename ! self.parsed_module = getDocs(filename, includeComments=comments_flag) return --- 217,221 ---- comments_flag = self.include_comments.get(name, 1) self.filename = filename ! self.parsed_module = getDocs(None, filename, includeComments=comments_flag) return Index: suite.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/parseinfo/suite.py,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** suite.py 11 Nov 2001 18:51:37 -0000 1.1 --- suite.py 13 May 2002 01:14:44 -0000 1.1.2.1 *************** *** 131,138 **** def getConfigurationValues(self): "Return any HappyDoc configuration values related to this object." if self._parent: ! return self._parent.getConfigurationValues() ! else: ! return self._configuration_values def _extractInfo(self, tree): --- 131,143 ---- def getConfigurationValues(self): "Return any HappyDoc configuration values related to this object." + values = None if self._parent: ! try: ! values = self._parent.getConfigurationValues() ! except: ! values = None ! if values is None: ! values = self._configuration_values ! return values def _extractInfo(self, tree): |
From: Doug H. <dou...@us...> - 2002-05-13 01:14:48
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib/docset In directory usw-pr-cvs1:/tmp/cvs-serv10733/happydoclib/docset Modified Files: Tag: dos_path_bug docset_MultipleFile.py Log Message: Initial pass at a fix for the Win32 path problems, including simplifying the definition of the path to the output file for an objects documentation. Index: docset_MultipleFile.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/docset/docset_MultipleFile.py,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** docset_MultipleFile.py 9 Dec 2001 15:36:33 -0000 1.5 --- docset_MultipleFile.py 13 May 2002 01:14:44 -0000 1.5.2.1 *************** *** 103,106 **** --- 103,107 ---- def write(self): "Write the documentation set to the output." + happydoclib.TRACE.into('MultiFileDocSet', 'write') self.statusMessage('Beginning to write...') # *************** *** 108,112 **** --- 109,115 ---- # self._root_name = self._formatter.getFullOutputNameForObject(None) + happydoclib.TRACE.writeVar(root_name=self._root_name) self._root_node = self.openOutput( self._root_name, self._title, '' ) + happydoclib.TRACE.writeVar(root_node=self._root_node) # # Get the description for the docset from the *************** *** 126,129 **** --- 129,133 ---- # self.close() + happydoclib.TRACE.outof() return *************** *** 158,173 **** # for x in items: ! happydoclib.TRACE.into('', 'loop', x=x) node_name = x[0] happydoclib.TRACE.writeVar(node_name=node_name) dir_name = happydoclib.path.dirname(x[1].getFilename()) happydoclib.TRACE.writeVar(dir_name=dir_name) if removePrefix: happydoclib.TRACE.write('removing prefix') dir_name = happydoclib.path.removeRelativePrefix( dir_name ) file_name = x[1].getFilename() happydoclib.TRACE.writeVar(file_name=file_name) rec = (dir_name, file_name, node_name) subnode_ids.append(rec) happydoclib.TRACE.outof(rec) # --- 162,184 ---- # for x in items: ! happydoclib.TRACE.into('inputDict.items()', 'loop', x=x) ! node_name = x[0] happydoclib.TRACE.writeVar(node_name=node_name) + dir_name = happydoclib.path.dirname(x[1].getFilename()) happydoclib.TRACE.writeVar(dir_name=dir_name) + if removePrefix: happydoclib.TRACE.write('removing prefix') dir_name = happydoclib.path.removeRelativePrefix( dir_name ) + happydoclib.TRACE.writeVar(dir_name=dir_name) + file_name = x[1].getFilename() happydoclib.TRACE.writeVar(file_name=file_name) + rec = (dir_name, file_name, node_name) subnode_ids.append(rec) + happydoclib.TRACE.outof(rec) # *************** *** 176,189 **** # for dir_name, file_name, subnode_name in subnode_ids: ! happydoclib.TRACE.writeVar(dir_name=dir_name) ! happydoclib.TRACE.writeVar(file_name=file_name) ! happydoclib.TRACE.writeVar(subnode_name=subnode_name) ! #print 'DIR : %s' % dir_name ! #print 'FILE : %s' % file_name ! #print 'NODE : %s' % subnode_name ! #print l = outputDict.get(dir_name, []) l.append( (file_name, subnode_name, inputDict) ) outputDict[dir_name] = l happydoclib.TRACE.outof() return --- 187,199 ---- # for dir_name, file_name, subnode_name in subnode_ids: ! happydoclib.TRACE.into('subnode_ids', 'loop', ! dir_name=dir_name, ! file_name=file_name, ! subnode_name=subnode_name) l = outputDict.get(dir_name, []) l.append( (file_name, subnode_name, inputDict) ) outputDict[dir_name] = l + happydoclib.TRACE.outof() + happydoclib.TRACE.outof() return *************** *** 192,195 **** --- 202,206 ---- "Output the TOC." happydoclib.TRACE.into('MultiFileDocSet', '_writeTOC') + happydoclib.TRACE.writeVar(docset_name=self.getName()) self.statusMessage() self.statusMessage('Writing table of contents...') *************** *** 207,210 **** --- 218,222 ---- self._organizeSubNodesByDir(subnodes_by_dir, self._all_modules, removePrefix=1) self._organizeSubNodesByDir(subnodes_by_dir, self._all_packages, removePrefix=0) + happydoclib.TRACE.writeVar(subnodes_by_dir=subnodes_by_dir) # *************** *** 219,223 **** for dir_name in dirs: ! happydoclib.TRACE.into('', '', directory=dir_name) relative_dir_name = happydoclib.path.removeRelativePrefix(dir_name) # --- 231,235 ---- for dir_name in dirs: ! happydoclib.TRACE.into('dirs', 'loop', directory=dir_name) relative_dir_name = happydoclib.path.removeRelativePrefix(dir_name) # *************** *** 265,270 **** --- 277,289 ---- subnode_set.sort(lambda x, y: cmp(x[1], y[1])) for file_name, subnode_name, subnode_dict in subnode_set: + happydoclib.TRACE.into('subnode_set', 'loop', + file_name=file_name, + subnode_name=subnode_name, + subnode_dict=subnode_dict, + ) + subnode = subnode_dict[subnode_name] self.statusMessage('\tAdding %s to TOC' % subnode_name, 2) + # # Build a reference to the documentation for the subnode *************** *** 272,277 **** --- 291,298 ---- # new_ref = subnode.getReference(formatter, self._root_node) + happydoclib.TRACE.writeVar(root_node_name=self._root_node.name) happydoclib.TRACE.writeVar(new_ref=new_ref) + if hasattr( subnode, 'getFullOutputNameForObject' ): happydoclib.TRACE.write('using getFullOutputNameForObject') *************** *** 285,288 **** --- 306,310 ---- self._root_name, ) + happydoclib.TRACE.writeVar(ref=ref) subnode_summary, subnode_format = subnode.getSummaryAndFormat() *************** *** 293,298 **** --- 315,324 ---- subnode_format, ) + + happydoclib.TRACE.outof() + formatter.descriptiveListFooter(self._root_node) happydoclib.TRACE.outof() + # # Close the Modules section *************** *** 385,389 **** def _describeClassInModuleNode(self, output, class_output_file_name, class_info): ! ref = self._formatter.getReference(class_info, class_output_file_name) class_info_summary, class_info_format = class_info.getSummaryAndFormat() self._formatter.descriptiveListItem( output, --- 411,421 ---- def _describeClassInModuleNode(self, output, class_output_file_name, class_info): ! happydoclib.TRACE.into('', '_describeClassInModuleNode', ! output=output, ! class_output_file_name=class_output_file_name, ! class_info=class_info, ! ) ! #ref = self._formatter.getReference(class_info, class_output_file_name) ! ref = self._formatter.getReference(class_info, output.name) class_info_summary, class_info_format = class_info.getSummaryAndFormat() self._formatter.descriptiveListItem( output, *************** *** 392,395 **** --- 424,428 ---- class_info_format, ) + happydoclib.TRACE.outof() return *************** *** 535,540 **** --- 568,575 ---- class_names.sort() for class_name in class_names: + happydoclib.TRACE.into('class_names', 'loop', class_name=class_name) c = module.getClassInfo(class_name) class_output_name = formatter.getFullOutputNameForObject(c) + happydoclib.TRACE.writeVar(class_output_name=class_output_name) self._describeClassInModuleNode(output, class_output_name , c) class_output = self.openOutput(class_output_name, *************** *** 543,546 **** --- 578,582 ---- self._writeClass( module, class_name, class_output ) self.closeOutput(class_output) + happydoclib.TRACE.outof() formatter.descriptiveListFooter(output) formatter.sectionFooter( output ) *************** *** 587,590 **** --- 623,631 ---- def _writeClass(self, parent, class_name, output): "Output the documentation for the class in the parent object." + happydoclib.TRACE.into('MultiFileDocSet', '_writeClass', + parent=parent, + class_name=class_name, + output=output, + ) class_info = parent.getClassInfo(class_name) formatter = self._formatter *************** *** 598,601 **** --- 639,643 ---- # base_classes = self._filterNames(class_info.getBaseClassNames()) + happydoclib.TRACE.writeVar(base_classes=base_classes) if base_classes: formatter.pushSectionLevel(output) *************** *** 632,635 **** --- 674,678 ---- output) formatter.sectionFooter(output) + # # Finish that indented level. *************** *** 638,641 **** --- 681,686 ---- formatter.popSectionLevel(output) formatter.comment('END: Class %s' % class_name, output) + + happydoclib.TRACE.outof() return |
From: Doug H. <dou...@us...> - 2002-05-13 01:14:47
|
Update of /cvsroot/happydoc/HappyDoc In directory usw-pr-cvs1:/tmp/cvs-serv10733 Modified Files: Tag: dos_path_bug test_happydoc.py Log Message: Initial pass at a fix for the Win32 path problems, including simplifying the definition of the path to the output file for an objects documentation. Index: test_happydoc.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/test_happydoc.py,v retrieving revision 1.83 retrieving revision 1.83.2.1 diff -C2 -d -r1.83 -r1.83.2.1 *** test_happydoc.py 12 May 2002 20:16:38 -0000 1.83 --- test_happydoc.py 13 May 2002 01:14:44 -0000 1.83.2.1 *************** *** 109,113 **** return ! def runHappyDoc(self, modules=(), extraArgs=(), useWebChecker=WEBCHECKER_AVAILABLE): # # Fix up output directory variable --- 109,113 ---- return ! def runHappyDoc(self, modules=(), extraArgs=(), useWebChecker=0): # # Fix up output directory variable *************** *** 178,182 **** c = webchecker.Checker() c.setflags( checkext=0, verbose=2, nonames=1 ) ! url = os.path.join(output_dir, 'index.html') c.addroot( url ) c.run() --- 178,199 ---- c = webchecker.Checker() c.setflags( checkext=0, verbose=2, nonames=1 ) ! ! # ! # Work out the output prefix, if one was specified. This is ! # used to determine the real root filename, since it will ! # also include the prefix value. ! # ! prefix = '' ! for extra_arg in extraArgs: ! try: ! name, value = extra_arg.split('=') ! except ValueError: ! pass ! else: ! if name == 'formatter_filenamePrefix': ! prefix = value ! break ! ! url = os.path.join(output_dir, '%sindex.html' % prefix) c.addroot( url ) c.run() |
From: Doug H. <dou...@us...> - 2002-05-13 01:14:47
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib/formatter In directory usw-pr-cvs1:/tmp/cvs-serv10733/happydoclib/formatter Modified Files: Tag: dos_path_bug fileformatterbase.py formatter_HTMLFile.py Log Message: Initial pass at a fix for the Win32 path problems, including simplifying the definition of the path to the output file for an objects documentation. Index: fileformatterbase.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/formatter/fileformatterbase.py,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** fileformatterbase.py 10 Feb 2002 13:07:00 -0000 1.8 --- fileformatterbase.py 13 May 2002 01:14:44 -0000 1.8.2.1 *************** *** 119,126 **** --- 119,129 ---- the output path to create a full path. """ + happydoclib.TRACE.into('FileBasedFormatter', 'fixUpOutputFilename', + filename=filename) # # Remove preceding slashes to make name relative # filename = happydoclib.path.removeRelativePrefix(filename) + happydoclib.TRACE.writeVar(filename_after_remove_relative_prefix=filename) # # Apply the path prefix, if required *************** *** 129,132 **** --- 132,137 ---- filename = happydoclib.path.applyPrefixToPath( filename, self.getFilenamePrefix()) + happydoclib.TRACE.writeVar(filename_after_apply_prefix=filename) + happydoclib.TRACE.outof(filename) return filename *************** *** 142,149 **** --- 147,156 ---- filename=filename) filename = self.fixUpOutputFilename(filename) + happydoclib.TRACE.writeVar(filename=filename) # # Set the correct extension for the output file # extension = self.getFilenameExtension() + happydoclib.TRACE.writeVar(extension=extension) # # Build the name *************** *** 163,179 **** happydoclib.TRACE.into('FileBasedFormatter', 'getOutputNameForObject', infoObject=infoObject) if type(infoObject) == types.StringType: ! happydoclib.TRACE.write('string') name = infoObject elif type(infoObject) == types.FileType: ! happydoclib.TRACE.write('file') name = infoObject.name elif infoObject is not None: ! happydoclib.TRACE.write('infoObject') ! name = self.getOutputNameForFile(infoObject.getFullyQualifiedName()) happydoclib.TRACE.write('file for %s' % infoObject.getName()) happydoclib.TRACE.write('is %s' % name) else: ! name = self.getRootNodeName() happydoclib.TRACE.outof(name) return name --- 170,199 ---- happydoclib.TRACE.into('FileBasedFormatter', 'getOutputNameForObject', infoObject=infoObject) + if type(infoObject) == types.StringType: ! happydoclib.TRACE.write('object is a string') name = infoObject + elif type(infoObject) == types.FileType: ! happydoclib.TRACE.write('object is a file') name = infoObject.name + elif infoObject is not None: ! happydoclib.TRACE.write('object is an infoObject') ! #name = self.getOutputNameForFile(infoObject.getFullyQualifiedName()) ! name = apply(happydoclib.path.join, infoObject.getPath() ) ! name = '%s.%s' % (name, self.getFilenameExtension()) happydoclib.TRACE.write('file for %s' % infoObject.getName()) happydoclib.TRACE.write('is %s' % name) + else: ! happydoclib.TRACE.write('object is a root node') ! docset_path = self._docset.getPath() ! if docset_path: ! name = apply(happydoclib.path.join, docset_path ) ! name = happydoclib.path.join(name, self.getRootNodeName()) ! else: ! name = self.getRootNodeName() ! happydoclib.TRACE.outof(name) return name *************** *** 196,200 **** return name - def getFullOutputNameForObject(self, infoObject): """Get the full name, including path, to the object being output. --- 216,219 ---- *************** *** 206,209 **** --- 225,285 ---- happydoclib.TRACE.into('FileBasedFormatter', 'getFullOutputNameForObject', infoObject=infoObject) + + # + # Get the basic output name for the object + # + obj_output_name = self.getOutputNameForObject(infoObject) + # + # Get the root output directory + # + output_base = self._docset.getOutputBaseDirectory() + # + # Get the base input directory for the docset + # + docset_base_directory = self._docset.getDocsetBaseDirectory() + + happydoclib.TRACE.writeVar(obj_output_name=obj_output_name) + happydoclib.TRACE.writeVar(docset_base_directory=docset_base_directory) + happydoclib.TRACE.writeVar(output_base=output_base) + + if (not infoObject) and docset_base_directory: + # + # For a docset root node, just tack the object + # output name onto the output base directory. + # + happydoclib.TRACE.write('ROOT NODE FOR CURRENT DOCSET') + name = happydoclib.path.join(output_base, obj_output_name) + + elif docset_base_directory: + # + # Here we have a real HappyDOM based object. + # + happydoclib.TRACE.write('SUBNODE OF DOCSET') + #obj_parent_path = infoObject.getParent().getPath() + #obj_parent_path = infoObject.getPath() + #obj_parent_file_path = apply(os.path.join, obj_parent_path) + #output_dir = happydoclib.path.join(output_base, obj_parent_file_path) + name = happydoclib.path.join(output_base, obj_output_name) + + else: + happydoclib.TRACE.write('OTHER') + # + # How can we get here? + # + name = self.getOutputNameForObject(infoObject) + + happydoclib.TRACE.outof(name) + return name + + + def old_getFullOutputNameForObject(self, infoObject): + """Get the full name, including path, to the object being output. + + The prefix of the return value should be the output path for + all documentation. The rest of the return value will be based + on the path to the source for the object. + """ + happydoclib.TRACE.into('FileBasedFormatter', 'getFullOutputNameForObject', + infoObject=infoObject) obj_output_name = self.getOutputNameForObject(infoObject) *************** *** 216,246 **** if (not infoObject) and docset_base_directory: ! happydoclib.TRACE.write('root node for docset') # # Root node for docset # ! output_subdir = happydoclib.path.removePrefix(docset_base_directory, output_base) happydoclib.TRACE.writeVar(output_subdir=output_subdir) ! if os.name != 'nt': ! happydoclib.TRACE.write('adding prefix for os %s' % os.name) ! output_subdir = '%s%s' % (os.sep, output_subdir) happydoclib.TRACE.writeVar(output_subdir=output_subdir) ! if output_subdir != output_base: ! happydoclib.TRACE.write('output_subdir and output_base do not match') ! if output_subdir[0] == os.sep: ! output_subdir=output_subdir[1:] ! happydoclib.TRACE.writeVar(output_subdir=output_subdir) ! obj_output_sub_path = happydoclib.path.join(output_subdir, obj_output_name) ! happydoclib.TRACE.writeVar(obj_output_sub_path=obj_output_sub_path) ! obj_output_sub_path = self.fixUpOutputFilename(obj_output_sub_path) ! happydoclib.TRACE.writeVar(obj_output_sub_path=obj_output_sub_path) ! name = happydoclib.path.join(output_base, obj_output_sub_path) ! else: ! happydoclib.TRACE.write('output_subdir and output_base do match') ! name = happydoclib.path.join(output_base, obj_output_name) elif docset_base_directory: ! happydoclib.TRACE.write('subnode of docset') # # Subnode of docset --- 292,338 ---- if (not infoObject) and docset_base_directory: ! happydoclib.TRACE.write('ROOT NODE FOR CURRENT DOCSET') # # Root node for docset # ! happydoclib.TRACE.writeVar(docset_base_directory=docset_base_directory) ! happydoclib.TRACE.writeVar(output_base=output_base) ! ! common_prefix = happydoclib.path.commonPrefix(docset_base_directory, output_base) ! happydoclib.TRACE.writeVar(common_prefix=common_prefix) ! ! #output_subdir = happydoclib.path.removePrefix(docset_base_directory, output_base) ! output_subdir = happydoclib.path.removePrefix(docset_base_directory, common_prefix) happydoclib.TRACE.writeVar(output_subdir=output_subdir) ! output_subdir = happydoclib.path.join(output_base, output_subdir) happydoclib.TRACE.writeVar(output_subdir=output_subdir) ! name = happydoclib.path.join(output_subdir, obj_output_name) ! # if os.name != 'nt': ! # happydoclib.TRACE.write('adding prefix for os %s' % os.name) ! # output_subdir = '%s%s' % (os.sep, output_subdir) ! # happydoclib.TRACE.writeVar(output_subdir=output_subdir) ! # if output_subdir != output_base: ! # happydoclib.TRACE.write('output_subdir (%s) and' % output_subdir) ! # happydoclib.TRACE.write('and output_base (%s) do not match' % output_base) ! # if output_subdir[0] == os.sep: ! # output_subdir=output_subdir[1:] ! # elif os.name == 'nt': ! # drive, output_subdir = os.path.splitdrive(output_subdir) ! # happydoclib.TRACE.writeVar(output_subdir=output_subdir) ! # obj_output_sub_path = happydoclib.path.join(output_subdir, obj_output_name) ! # happydoclib.TRACE.writeVar(obj_output_sub_path=obj_output_sub_path) ! # obj_output_sub_path = self.fixUpOutputFilename(obj_output_sub_path) ! # if obj_output_sub_path[0] == os.sep: ! # obj_output_sub_path = obj_output_sub_path[1:] ! # happydoclib.TRACE.writeVar(obj_output_sub_path=obj_output_sub_path) ! ! # name = happydoclib.path.join(output_base, obj_output_sub_path) ! # else: ! # happydoclib.TRACE.write('output_subdir and output_base do match') ! # name = happydoclib.path.join(output_base, obj_output_name) elif docset_base_directory: ! happydoclib.TRACE.write('SUBNODE OF DOCSET') # # Subnode of docset *************** *** 248,252 **** file_name = self.getOutputNameForObject(infoObject) happydoclib.TRACE.writeVar(file_name=file_name) ! name = happydoclib.path.join(output_base, file_name) #name = happydoclib.path.joinWithCommonMiddle( # output_base, --- 340,354 ---- file_name = self.getOutputNameForObject(infoObject) happydoclib.TRACE.writeVar(file_name=file_name) ! ! common_prefix = happydoclib.path.commonPrefix(output_base, file_name) ! #common_prefix = happydoclib.path.commonPrefix(docset_base_directory, file_name) ! ! happydoclib.TRACE.writeVar(common_prefix=common_prefix) ! ! sub_file_name = happydoclib.path.removePrefix(file_name, common_prefix) ! happydoclib.TRACE.writeVar(sub_file_name=sub_file_name) ! ! name = happydoclib.path.join(output_base, sub_file_name) ! #name = happydoclib.path.join(output_base, file_name) #name = happydoclib.path.joinWithCommonMiddle( # output_base, *************** *** 256,260 **** else: ! happydoclib.TRACE.write('other') # # How can we get here? --- 358,362 ---- else: ! happydoclib.TRACE.write('OTHER') # # How can we get here? *************** *** 289,296 **** --- 391,404 ---- output_base_dir = os.sep + os.path.join('tmp', 'fakedocset', 'output') + if os.name == 'nt': + output_base_dir_win32 = 'c:\\%s' % output_base_dir[1:] def setUp(self): class FakeDocset: + + def getPath(self): + return [ ] + def getOutputBaseDirectory(self): return FileFormatterBaseTest.output_base_dir *************** *** 298,301 **** --- 406,416 ---- def getDocsetBaseDirectory(self): return os.sep + os.path.join('docset', 'base', 'directory') + + class FakeDocsetWin32: + def getOutputBaseDirectory(self): + return FileFormatterBaseTest.output_base_dir_win32 + + def getDocsetBaseDirectory(self): + return 'c:\\' + os.path.join('docset', 'base', 'directory') class TestFormatter(FileBasedFormatter): *************** *** 306,309 **** --- 421,425 ---- self.formatter = TestFormatter(FakeDocset()) + self.formatter_win32 = TestFormatter(FakeDocsetWin32()) return *************** *** 317,320 **** --- 433,446 ---- return + if os.name == 'nt': + def testFixUpOutputFilenameFromRootWin32(self): + expected = 'c:\\' + os.path.join('fix', 'up', 'filename') + actual = self.formatter.fixUpOutputFilename( + 'c:\\' + os.path.join('fix', 'up', 'filename') + ) + assert expected == actual, \ + 'Fixed filenames do not match ("%s" vs. "%s").' % (expected, actual) + return + def testFixUpOutputFilenameParentDir(self): expected = os.path.join('fix', 'up', 'filename') *************** *** 375,382 **** pass info_obj = FakeInfoObj('myfake', None, 'filename.py', []) ! expected = 'filename.py.test' actual = self.formatter.getOutputNameForObject(info_obj) assert expected == actual, \ ! 'Output name for object does not match ("%s" vs "%s")' % \ (expected, actual) return --- 501,508 ---- pass info_obj = FakeInfoObj('myfake', None, 'filename.py', []) ! expected = 'myfake.test' actual = self.formatter.getOutputNameForObject(info_obj) assert expected == actual, \ ! 'Output name for object does not match (\n"%s"\nvs\n"%s")' % \ (expected, actual) return *************** *** 388,395 **** parent_obj = FakeInfoObj('myfakeparent', None, 'parent', []) info_obj = FakeInfoObj('myfake', parent_obj, 'filename.py', []) ! expected = 'parent_myfake.test' actual = self.formatter.getOutputNameForObject(info_obj) assert expected == actual, \ ! 'Output name for object does not match ("%s" vs "%s")' % \ (expected, actual) return --- 514,521 ---- parent_obj = FakeInfoObj('myfakeparent', None, 'parent', []) info_obj = FakeInfoObj('myfake', parent_obj, 'filename.py', []) ! expected = 'myfakeparent/myfake.test' actual = self.formatter.getOutputNameForObject(info_obj) assert expected == actual, \ ! 'Output name for object does not match (\n"%s"\nvs\n"%s")' % \ (expected, actual) return *************** *** 424,452 **** class FakeInfoObj(happydoclib.happydom.HappyDOM): pass ! info_obj = FakeInfoObj('myfake', None, 'filename.py', []) expected = os.sep + os.path.join('tmp', 'fakedocset', 'output', ! 'filename.py.test' ) actual = self.formatter.getFullOutputNameForObject(info_obj) assert expected == actual, \ ! 'Output name for object does not match ("%s" vs "%s")' % \ (expected, actual) return def testGetFullOutputNameForObjectNone(self): info_obj = None ! expected = os.sep + os.path.join('tmp', ! 'fakedocset', ! 'output', ! 'docset', ! 'base', ! 'directory', ! 'index.test' ! ) actual = self.formatter.getFullOutputNameForObject(info_obj) assert expected == actual, \ ! 'Output name for object does not match ("%s" vs "%s")' % \ (expected, actual) return def testGetFullOutputNameForObjectFullyQualifiedNameOneParent(self): --- 550,612 ---- class FakeInfoObj(happydoclib.happydom.HappyDOM): pass ! info_obj = FakeInfoObj('filename', None, 'filename.py', []) expected = os.sep + os.path.join('tmp', 'fakedocset', 'output', ! 'filename.test' ) actual = self.formatter.getFullOutputNameForObject(info_obj) assert expected == actual, \ ! 'Output name for object does not match\n(\n"%s"\nvs\n"%s")' % \ (expected, actual) return + if os.name == 'nt': + def testGetFullOutputNameForObjectFullyQualifiedNameRootWin32(self): + import happydoclib + import happydoclib.happydom + happydoclib.TRACE.verboseLevel = 1 + class FakeInfoObj(happydoclib.happydom.HappyDOM): + pass + info_obj = FakeInfoObj('myfake', None, 'filename.py', []) + expected = happydoclib.path.join( + 'c:\\', + os.path.join('tmp', 'fakedocset', 'output', 'filename.py.test') + ) + actual = self.formatter_win32.getFullOutputNameForObject(info_obj) + assert expected == actual, \ + 'Output name for object does not match (expect "%s", got "%s")' % \ + (expected, actual) + return + def testGetFullOutputNameForObjectNone(self): info_obj = None ! expected = os.sep + os.path.join( ! 'tmp', ! 'fakedocset', ! 'output', ! 'index.test' ! ) actual = self.formatter.getFullOutputNameForObject(info_obj) assert expected == actual, \ ! 'Output name for object does not match (\n"%s"\nvs\n"%s")' % \ (expected, actual) return + + if os.name == 'nt': + def testGetFullOutputNameForObjectNoneWin32(self): + info_obj = None + expected = os.path.join('c:\\', + 'tmp', + 'fakedocset', + 'output', + 'docset', + 'base', + 'directory', + 'index.test' + ) + actual = self.formatter_win32.getFullOutputNameForObject(info_obj) + assert expected == actual, \ + 'Output name for object does not match (expected "%s", got "%s")' % \ + (expected, actual) + return def testGetFullOutputNameForObjectFullyQualifiedNameOneParent(self): *************** *** 454,465 **** class FakeInfoObj(happydoclib.happydom.HappyDOM): pass ! parent_obj = FakeInfoObj('myfakeparent', None, 'parent', []) info_obj = FakeInfoObj('myfake', parent_obj, 'filename.py', []) expected = os.sep + os.path.join('tmp', 'fakedocset', 'output', ! 'parent_myfake.test' ) actual = self.formatter.getFullOutputNameForObject(info_obj) assert expected == actual, \ ! 'Output name for object does not match ("%s" vs "%s")' % \ (expected, actual) return --- 614,625 ---- class FakeInfoObj(happydoclib.happydom.HappyDOM): pass ! parent_obj = FakeInfoObj('myfakeparentname', None, 'myfakeparentfilename', []) info_obj = FakeInfoObj('myfake', parent_obj, 'filename.py', []) expected = os.sep + os.path.join('tmp', 'fakedocset', 'output', ! 'myfakeparentname', 'myfake.test' ) actual = self.formatter.getFullOutputNameForObject(info_obj) assert expected == actual, \ ! 'Output name for object does not match\n(\n"%s"\nvs\n"%s")' % \ (expected, actual) return *************** *** 472,476 **** actual = self.formatter.getFullOutputNameForFile(filename) assert expected == actual, \ ! 'Output name for file does not match ("%s" vs "%s")' % \ (expected, actual) return --- 632,636 ---- actual = self.formatter.getFullOutputNameForFile(filename) assert expected == actual, \ ! 'Output name for file does not match\n(\n"%s"\nvs\n"%s")' % \ (expected, actual) return *************** *** 484,488 **** actual = self.formatter.getFullOutputNameForFile(filename) assert expected == actual, \ ! 'Output name for file does not match ("%s" vs "%s")' % \ (expected, actual) return --- 644,648 ---- actual = self.formatter.getFullOutputNameForFile(filename) assert expected == actual, \ ! 'Output name for file does not match\n(\n"%s"\nvs\n"%s")' % \ (expected, actual) return Index: formatter_HTMLFile.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/formatter/formatter_HTMLFile.py,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** formatter_HTMLFile.py 10 Feb 2002 13:37:12 -0000 1.5 --- formatter_HTMLFile.py 13 May 2002 01:14:44 -0000 1.5.2.1 *************** *** 211,222 **** # Figure out the name of the infoSource # - - if not name: - name = self.getNameForInfoSource( infoSource ) happydoclib.TRACE.into('HTMLTableFormatter', 'getReference', name=name, relativeSource=relativeSource, ) ! info_source_path = self.getOutputNameForObject( infoSource ) link = happydoclib.path.computeRelativeHTMLLink( relativeSource, --- 211,230 ---- # Figure out the name of the infoSource # happydoclib.TRACE.into('HTMLTableFormatter', 'getReference', + infoSource=infoSource, name=name, relativeSource=relativeSource, ) ! ! if hasattr(infoSource, 'getPath'): ! path = infoSource.getPath() ! happydoclib.TRACE.writeVar(path=path) ! if not name: ! name = self.getNameForInfoSource( infoSource ) ! happydoclib.TRACE.writeVar(name=name) ! ! info_source_path = self.getFullOutputNameForObject( infoSource ) ! happydoclib.TRACE.writeVar(info_source_path=info_source_path) ! link = happydoclib.path.computeRelativeHTMLLink( relativeSource, *************** *** 224,228 **** self._docset.getOutputBaseDirectory() ) ! happydoclib.TRACE.write('link to %s: %s' % (name, link)) if link[0] == '/': happydoclib.TRACE.write('starts at root') --- 232,237 ---- self._docset.getOutputBaseDirectory() ) ! happydoclib.TRACE.write('Name is "%s"' % name) ! happydoclib.TRACE.writeVar(link=link) if link[0] == '/': happydoclib.TRACE.write('starts at root') *************** *** 235,239 **** --- 244,253 ---- } ref = '<a href="%(link)s">%(name)s</a>' % info + #if link=='formatterloader.html': + # raise 'DEBUG HERE' + #print 'REFERENCE:', ref + return happydoclib.TRACE.outof(ref) + *************** *** 431,441 **** <table border="0" cellpadding="5" cellspacing="0" width="100%%"> ! <tr bgcolor="%(title_bg)s"> <th rowspan="2" valign="top" align="left" ! width="10%%"><font color="%(title_fg)s">%(title)s</font> </th> - <th width="90%%" align="right"><font color="%(title_fg)s">%(subtitle)s</font></th> </tr> <tr> --- 445,459 ---- <table border="0" cellpadding="5" cellspacing="0" width="100%%"> ! <tr> <th rowspan="2" valign="top" align="left" ! width="10%%" ! bgcolor="%(title_bg)s"><font color="%(title_fg)s">%(title)s</font> ! </th> ! <th bgcolor="%(title_bg)s" ! width="90%%" ! align="right"><font color="%(title_fg)s">%(subtitle)s</font> </th> </tr> <tr> *************** *** 664,668 **** def descriptiveListItem(self, output, item, description, descriptionFormat): "Format and write the 'item' and 'description' for a descriptive list to the 'output'." ! self.writeHTML('<tr><td valign="top" align="left">%s</td>' % item, output) self.writeHTML('<td valign="top" align="left">', output) --- 682,686 ---- def descriptiveListItem(self, output, item, description, descriptionFormat): "Format and write the 'item' and 'description' for a descriptive list to the 'output'." ! self.writeHTML('<tr><td valign="top" align="left"><p>%s</p></td>' % item, output) self.writeHTML('<td valign="top" align="left">', output) *************** *** 804,808 **** formatter = docset._formatter reference = formatter.getNamedReference( cla, 'CommandLineApp', 'index.html' ) ! expected_reference = '<a href="happydoclib%sCommandLineApp.py.html#CommandLineApp">CommandLineApp</a>' % os.sep assert reference == expected_reference, 'Got reference "%s" instead of "%s"' % \ (reference, expected_reference) --- 822,826 ---- formatter = docset._formatter reference = formatter.getNamedReference( cla, 'CommandLineApp', 'index.html' ) ! expected_reference = '<a href="CommandLineApp.html#CommandLineApp">CommandLineApp</a>' assert reference == expected_reference, 'Got reference "%s" instead of "%s"' % \ (reference, expected_reference) |
From: Doug H. <dou...@us...> - 2002-05-13 01:14:47
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib/docstring In directory usw-pr-cvs1:/tmp/cvs-serv10733/happydoclib/docstring Modified Files: Tag: dos_path_bug docstring_ClassicStructuredText.py Log Message: Initial pass at a fix for the Win32 path problems, including simplifying the definition of the path to the output file for an objects documentation. Index: docstring_ClassicStructuredText.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/docstring/docstring_ClassicStructuredText.py,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** docstring_ClassicStructuredText.py 28 Oct 2001 13:40:25 -0000 1.2 --- docstring_ClassicStructuredText.py 13 May 2002 01:14:44 -0000 1.2.2.1 *************** *** 357,361 **** filename = 'TestCases/test_classic_structuredtext.py' import happydoclib.parseinfo ! parsed_module = happydoclib.parseinfo.getDocs(filename) input_text = parsed_module._docstring --- 357,361 ---- filename = 'TestCases/test_classic_structuredtext.py' import happydoclib.parseinfo ! parsed_module = happydoclib.parseinfo.getDocs(None, filename) input_text = parsed_module._docstring |
From: Doug H. <dou...@us...> - 2002-05-12 21:22:32
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib/docstring In directory usw-pr-cvs1:/tmp/cvs-serv24432/happydoclib/docstring Modified Files: docstring_StructuredText.py Log Message: Updated trace statement. Index: docstring_StructuredText.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/docstring/docstring_StructuredText.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** docstring_StructuredText.py 10 Feb 2002 13:18:41 -0000 1.4 --- docstring_StructuredText.py 12 May 2002 21:22:29 -0000 1.5 *************** *** 286,292 **** html_quoted) happydoclib.TRACE.write('AFTER FIXUP="%s"' % html_quoted) return html_quoted ! happydoclib.TRACE.outof(inputText) return inputText --- 286,293 ---- html_quoted) happydoclib.TRACE.write('AFTER FIXUP="%s"' % html_quoted) + happydoclib.TRACE.outof() return html_quoted ! happydoclib.TRACE.outof() return inputText |
From: Doug H. <dou...@us...> - 2002-05-12 20:19:04
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib In directory usw-pr-cvs1:/tmp/cvs-serv8851/happydoclib Modified Files: trace.py Log Message: Print repr() of values instead of str(). Index: trace.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/trace.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** trace.py 10 Feb 2002 13:02:25 -0000 1.4 --- trace.py 12 May 2002 20:19:01 -0000 1.5 *************** *** 141,145 **** params.sort() for name, value in params: ! self.output.write('\n%s\t%s=%s, ' % (self.getIndent(), name, value)) self.output.write(') {\n') self.pushLevel((className, functionName)) --- 141,145 ---- params.sort() for name, value in params: ! self.output.write('\n%s\t%s=%s, ' % (self.getIndent(), name, repr(value))) self.output.write(') {\n') self.pushLevel((className, functionName)) *************** *** 172,176 **** vars.sort() for name, value in vars: ! self.output.write('\n%s\t%s=%s' % (self.getIndent(), name, value)) self.output.write('\n') else: --- 172,176 ---- vars.sort() for name, value in vars: ! self.output.write('\n%s\t%s=%s' % (self.getIndent(), name, repr(value))) self.output.write('\n') else: *************** *** 184,188 **** variables.sort() for name, value in variables: ! self.write('%s=%s' % (name, value)) return --- 184,188 ---- variables.sort() for name, value in variables: ! self.write('%s=%s' % (name, repr(value))) return *************** *** 198,202 **** self.popLevel() self.output.write(self.getIndent()) ! self.output.write('} %s\n' % str(returnValue)) return returnValue --- 198,202 ---- self.popLevel() self.output.write(self.getIndent()) ! self.output.write('} %s\n' % repr(returnValue)) return returnValue *************** *** 229,243 **** Called by: () __main__::topLevel ( ! a=a, ! b=b, ) { Called by: (('__main__', 'topLevel'), ()) hi there secondary::secondLevel ( ! c=C, ! d=D, ) { inside second level Called by: (('secondary', 'secondLevel'), (('__main__', 'topLevel'), ())) } None ! } string returned """ actual_output = buffer.getvalue() --- 229,243 ---- Called by: () __main__::topLevel ( ! a='a', ! b='b', ) { Called by: (('__main__', 'topLevel'), ()) hi there secondary::secondLevel ( ! c='C', ! d='D', ) { inside second level Called by: (('secondary', 'secondLevel'), (('__main__', 'topLevel'), ())) } None ! } 'string returned' """ actual_output = buffer.getvalue() |
From: Doug H. <dou...@us...> - 2002-05-12 20:17:59
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib In directory usw-pr-cvs1:/tmp/cvs-serv8630/happydoclib Modified Files: appclass.py Log Message: Use os.path.normalize() on input file and directory names. Index: appclass.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/appclass.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** appclass.py 2 Feb 2002 13:45:29 -0000 1.8 --- appclass.py 12 May 2002 20:17:56 -0000 1.9 *************** *** 246,250 **** Defaults to './doc'.""" ! self.output_directory = outputDirectory return --- 246,250 ---- Defaults to './doc'.""" ! self.output_directory = os.path.normcase(outputDirectory) return *************** *** 379,384 **** # Get the list of modules to input # ! input_modules = args ! if not input_modules: # # No files specified, print a help message and exit. --- 379,383 ---- # Get the list of modules to input # ! if not args: # # No files specified, print a help message and exit. *************** *** 386,389 **** --- 385,392 ---- 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)) # |
From: Doug H. <dou...@us...> - 2002-05-12 20:17:08
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib In directory usw-pr-cvs1:/tmp/cvs-serv8505/happydoclib Modified Files: StreamFlushTest.py Log Message: Save the filenames for the stdout and stderr streams. Index: StreamFlushTest.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/StreamFlushTest.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** StreamFlushTest.py 31 Jan 2002 13:20:25 -0000 1.3 --- StreamFlushTest.py 12 May 2002 20:17:06 -0000 1.4 *************** *** 152,157 **** self.saved_sys_stderr = sys.stderr self.path_module.rmkdir(output_dir) ! sys.stdout = open( os.path.join(output_dir, 'stdout.txt'), 'w' ) ! sys.stderr = open( os.path.join(output_dir, 'stderr.txt'), 'w' ) return --- 152,159 ---- self.saved_sys_stderr = sys.stderr self.path_module.rmkdir(output_dir) ! self.stdout_filename = os.path.join(output_dir, 'stdout.txt') ! self.stderr_filename = os.path.join(output_dir, 'stderr.txt') ! sys.stdout = open( self.stdout_filename, 'w' ) ! sys.stderr = open( self.stderr_filename, 'w' ) return |
From: Doug H. <dou...@us...> - 2002-05-12 20:16:41
|
Update of /cvsroot/happydoc/HappyDoc In directory usw-pr-cvs1:/tmp/cvs-serv8380 Modified Files: test_happydoc.py Log Message: If webchecker is available, use it to check links in HTML output. Index: test_happydoc.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/test_happydoc.py,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** test_happydoc.py 7 Feb 2002 16:22:06 -0000 1.82 --- test_happydoc.py 12 May 2002 20:16:38 -0000 1.83 *************** *** 71,74 **** --- 71,83 ---- from happydoclib.StreamFlushTest import verboseLevel as globalVerboseLevel + WEB_CHECKER_DIR='/home/dhellmann/Downloads/Python-2.2/Tools/webchecker/' + + if os.path.exists(WEB_CHECKER_DIR) and (os.name == 'posix'): + sys.path.append(WEB_CHECKER_DIR) + import webchecker + WEBCHECKER_AVAILABLE=1 + else: + WEBCHECKER_AVAILABLE=0 + # # Modules with tests *************** *** 93,96 **** --- 102,107 ---- class HappyDocTestBase(StreamFlushTest): + + WEB_CHECKER = os.path.join(WEB_CHECKER_DIR, 'webchecker.py') def setUp(self): *************** *** 98,102 **** return ! def runHappyDoc(self, modules=(), extraArgs=()): # # Fix up output directory variable --- 109,113 ---- return ! def runHappyDoc(self, modules=(), extraArgs=(), useWebChecker=WEBCHECKER_AVAILABLE): # # Fix up output directory variable *************** *** 154,157 **** --- 165,185 ---- if msg: exit_code = 1 + + # + # Run webchecker to verify the links that were written to the + # output. + # + if useWebChecker and WEBCHECKER_AVAILABLE: + + if self.verboseLevel.get(): + print + print 'WebChecker:' + print + c = webchecker.Checker() + c.setflags( checkext=0, verbose=2, nonames=1 ) + url = os.path.join(output_dir, 'index.html') + c.addroot( url ) + c.run() + c.report() # *************** *** 207,211 **** def testHTMLSimple(self): assert (not self.runHappyDoc( (os.path.join('TestCases', 'test.py'),), ! extraArgs=('-p', '-',) ) ), 'Basic single-file docset test failed.' --- 235,240 ---- def testHTMLSimple(self): assert (not self.runHappyDoc( (os.path.join('TestCases', 'test.py'),), ! extraArgs=('-p', '-',), ! useWebChecker=1 ) ), 'Basic single-file docset test failed.' *************** *** 214,218 **** def testSelfHTMLCompact(self): assert (not self.runHappyDoc( (os.path.join('TestCases', 'test.py'),), ! extraArgs=('formatter_compactHTML=yes',)) ), 'Full self documentation with compact output test failed.' return --- 243,248 ---- def testSelfHTMLCompact(self): assert (not self.runHappyDoc( (os.path.join('TestCases', 'test.py'),), ! extraArgs=('formatter_compactHTML=yes',), ! useWebChecker=1) ), 'Full self documentation with compact output test failed.' return *************** *** 220,224 **** def testHTMLSingleFile(self): assert (not self.runHappyDoc( (os.path.join('TestCases', 'test.py'),), ! extraArgs=('-p', '-', '-T', 'SingleFile') ) ), 'Basic single-file docset test failed.' --- 250,255 ---- def testHTMLSingleFile(self): assert (not self.runHappyDoc( (os.path.join('TestCases', 'test.py'),), ! extraArgs=('-p', '-', '-T', 'SingleFile'), ! useWebChecker=1 ) ), 'Basic single-file docset test failed.' *************** *** 229,233 **** extraArgs=('-p', '-', '-T', 'SingleFile', 'formatter_compactHTML=yes', ! ) ) ), 'Basic single-file docset test failed.' --- 260,265 ---- extraArgs=('-p', '-', '-T', 'SingleFile', 'formatter_compactHTML=yes', ! ), ! useWebChecker=1 ) ), 'Basic single-file docset test failed.' *************** *** 236,240 **** def testHTMLStdout(self): assert (not self.runHappyDoc( (os.path.join('TestCases', 'test.py'),), ! extraArgs=('-T', 'StdOut') ) ), 'HTML to standard-output docset test failed.' --- 268,273 ---- def testHTMLStdout(self): assert (not self.runHappyDoc( (os.path.join('TestCases', 'test.py'),), ! extraArgs=('-T', 'StdOut'), ! useWebChecker=1 ) ), 'HTML to standard-output docset test failed.' *************** *** 272,275 **** --- 305,309 ---- assert (not self.runHappyDoc( (os.path.join('TestCases', 'test_import_packages_basic'),), + useWebChecker=1 ) ), 'Import from packages test failed.' *************** *** 279,283 **** assert (not self.runHappyDoc( (os.path.join('TestCases', 'test_import_packages'),), ! extraArgs=('docset_usePackages=0',), ) ), 'Import from packages while ignoring package special handling test failed.' --- 313,318 ---- assert (not self.runHappyDoc( (os.path.join('TestCases', 'test_import_packages'),), ! extraArgs=('docset_usePackages=0',), ! useWebChecker=1 ) ), 'Import from packages while ignoring package special handling test failed.' *************** *** 289,293 **** extraArgs=('-p', '', ! 'formatter_filenamePrefix=TESTPREFIX_') ) ), 'Formatter output prefix test failed.' --- 324,329 ---- extraArgs=('-p', '', ! 'formatter_filenamePrefix=TESTPREFIX_'), ! useWebChecker=1 ) ), 'Formatter output prefix test failed.' *************** *** 300,303 **** --- 336,340 ---- def testSelfHTML(self): assert (not self.runHappyDoc( (os.path.join(os.pardir, 'HappyDoc'),), + useWebChecker=1 ) ), 'Full self documentation test failed.' *************** *** 321,324 **** --- 358,362 ---- ), 'Full self documentation in DocBookS format output test failed.' return + class OtherWorkingDirTest(HappyDocTestBase): |
From: Doug H. <dou...@us...> - 2002-03-31 22:15:38
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib In directory usw-pr-cvs1:/tmp/cvs-serv21157/happydoclib Modified Files: pluginloader.py Log Message: Added several trace statements to clean up trace output. Index: pluginloader.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/pluginloader.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pluginloader.py 7 Feb 2002 14:26:44 -0000 1.3 --- pluginloader.py 31 Mar 2002 22:15:35 -0000 1.4 *************** *** 162,165 **** --- 162,166 ---- try: + TRACE.write('Importing %s' % _import_name) _module = __import__( _import_name ) except Exception, msg: *************** *** 168,174 **** --- 169,181 ---- buffer.write('\n--- Plugin Module Error ---\n') traceback.print_exc(file=buffer) + TRACE.into('PluginLoader' 'Plugin module error', + _import_name=_import_name) + TRACE.write(buffer.getvalue()) + TRACE.outof() buffer.write('---------------------------\n\n') + TRACE.outof() raise PluginException( buffer.getvalue(), _import_name ) elif int(os.environ.get('PLUGIN_SILENT_ERRORS', '0')): + TRACE.outof() continue else: *************** *** 176,179 **** --- 183,187 ---- traceback.print_exc() sys.stderr.write('---------------------------\n\n') + TRACE.outof() continue |
From: Doug H. <dou...@us...> - 2002-02-17 13:50:01
|
Update of /cvsroot/happydoc/HappyDoc/happydoclib In directory usw-pr-cvs1:/tmp/cvs-serv7321 Modified Files: path.py Log Message: Sorted imports. Added unittest.main() so these tests can be run individually. Index: path.py =================================================================== RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/path.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** path.py 3 Feb 2002 18:48:47 -0000 1.7 --- path.py 17 Feb 2002 13:49:49 -0000 1.8 *************** *** 58,65 **** # Import system modules # ! import string import os import sys ! import glob # --- 58,66 ---- # Import system modules # ! import glob import os + import string import sys ! import unittest # *************** *** 540,541 **** --- 541,546 ---- return + + if __name__ == '__main__': + unittest.main() + |