From mcfletch@golden.net Wed Apr 1 00:10:15 1998 From: mcfletch@golden.net (Mike Fletcher) Date: Tue, 31 Mar 1998 19:10:15 -0500 Subject: [Doc-SIG] Minor bugfix/optimisation for doc_collect In-Reply-To: <3520E865.65AF7459@vasteras.mail.telia.com> References: <01IVANBU0QGI009S9M@TUDRNV.TUDelft.NL> Message-ID: <3.0.2.32.19980331191015.00f54358@pop.golden.net> Evening all, Currently doc_collect does nasty things with at least one (perfectly valid) module I've written. The following seems to fix it, would appreciate input as to whether it would break anything: 8<___ doc_collect.py line 132+ ______ def whichmoduleobj(cls): """Figure out the module in which a class occurs. Search sys.modules for the module. Cache in classmap. Return a module object. If the class cannot be found, raise exception. """ ### Altered by mcfletch 98.03.31 to use 1.5 stuff if hasattr( cls, '__module__' ): try: import sys return sys.modules[ cls.__module__ ] # is this always imported??? except: pass ### End mcfletch alterations if _classmap.has_key(cls): return _classmap[cls] ... ________________________________ M i k e C . F l e t c h e r mcfletch@golden.net http://www.golden.net/~mcfletch/ ________________________________ Design, Consultation, Training Now available for hire From mcfletch@golden.net Wed Apr 1 02:05:22 1998 From: mcfletch@golden.net (Mike Fletcher) Date: Tue, 31 Mar 1998 21:05:22 -0500 Subject: [Doc-SIG] Bugfix II -- ManualPage.py In-Reply-To: <3520E865.65AF7459@vasteras.mail.telia.com> References: <01IVANBU0QGI009S9M@TUDRNV.TUDelft.NL> Message-ID: <3.0.2.32.19980331210522.00f56a08@pop.golden.net> Hi Daniel, Rewriting the hyperlink_regex in ManualPage so that it does a simple, deterministic search should fix the error around line 505 which you are currently working around (and for which the workaround can cause index errors)... You will, also need to reduce each index Caveat: I haven't got anything with links with which to test this, just a lot of files that are failing due to the indexerrors. Cheers, Mike 8<____ ManualPage.py line 109 _____ hyperlink_regex = regex.compile('HREF=\\([^:]*\\)\\(::\\)\\([^:]*\\)\\(/HREF\\)') 8<____ ManualPage.py line 500 _____ while 1: index = hyperlink_regex.search(text, index+len(rendered_link)) if index == -1: break link_len = len(hyperlink_regex.group(0)) # Group 1 is the link, group 3 the link text link, link_text = hyperlink_regex.group(1), hyperlink_regex.group(3) ________________________________ M i k e C . F l e t c h e r mcfletch@golden.net http://www.golden.net/~mcfletch/ ________________________________ Design, Consultation, Training Now available for hire From mcfletch@golden.net Wed Apr 1 02:31:40 1998 From: mcfletch@golden.net (Mike Fletcher) Date: Tue, 31 Mar 1998 21:31:40 -0500 Subject: [Doc-SIG] Bugfix II -- ManualPage.py In-Reply-To: <3.0.2.32.19980331210522.00f56a08@pop.golden.net> References: <3520E865.65AF7459@vasteras.mail.telia.com> <01IVANBU0QGI009S9M@TUDRNV.TUDelft.NL> Message-ID: <3.0.2.32.19980331213140.00f53a48@pop.golden.net> Ah, looking at the results, I see I do have plenty with which to test (they apparently mean something different than I'd assumed)... here's the re-revised version that works properly as far as I can see :) . Sorry for the static :-/ , Mike 8<____ ManualPage.py line 108 _____ # ___1____ ___2______ hyperlink_regex = regex.compile('HREF=\\([^:]*\\)::\\([^:]*\\)/HREF') 8<____ ManualPage.py line 500 _____ while 1: index = hyperlink_regex.search(text, index+len(rendered_link)) if index == -1: break link_len = len(hyperlink_regex.group(0)) # Group 1 is the link, group 3 the link text link, link_text = hyperlink_regex.group(1), hyperlink_regex.group(2) ________________________________ M i k e C . F l e t c h e r mcfletch@golden.net http://www.golden.net/~mcfletch/ ________________________________ Design, Consultation, Training Now available for hire From Daniel.Larsson@vasteras.mail.telia.com Wed Apr 1 12:51:18 1998 From: Daniel.Larsson@vasteras.mail.telia.com (Daniel Larsson) Date: Wed, 1 Apr 1998 14:51:18 +0200 Subject: [Doc-SIG] Bugfix II -- ManualPage.py In-Reply-To: <3.0.2.32.19980331213140.00f53a48@pop.golden.net> Message-ID: <000001bd5d6c$de37ec60$72bd43c3@Daniel.telia.com> Ok, I've included the bugfixes from Mike Fletcher. (And made a programming interface too, Mike). This time gendoc is released as a .zip file, since I'm sitting with a win95 machine at home... Look at http://starship.skyport.net/crew/danilo/download/gendoc-0.71.zip Cheers, Daniel From Edward Welbourne Thu Apr 2 09:52:51 1998 From: Edward Welbourne (Edward Welbourne) Date: Thu, 2 Apr 1998 09:52:51 GMT Subject: [Doc-SIG] Re: A documentation idea. In-Reply-To: References: Message-ID: <9804020952.AA23384@lslr6g.lsl.co.uk> Minor woops - the _Stat.__doc__ refers to `the 'stat' class' when, of course, it means `the 'stat' module' - and it omits this line from its end: .. [stat] external: decoding 'os.stat()' output. As for the putative tools.wrap, this gets imported into _Stat's namespace the first time it gets needed, so isn't there for gendoc. It takes two days for a message from home to reach the list ! Eddy.