[Python-Dev] More pydoc questions

David Abrahams dave@boost-consulting.com
Wed, 21 Aug 2002 14:45:35 -0400


From: "Jeff Epler" <jepler@unpythonic.net>

> On Wed, Aug 21, 2002 at 01:15:22PM -0400, David Abrahams wrote:
> > I recently added an invocation to help(my_extension_module) to the
> > Boost.Python test suite, to prove that I can give reasonable help
output.
> > Worked great for me, since I was always running the test from within
emacs.
> > However, some other developer complained that the test required user
> > intervention to run, since it would prompt at each screenful. So, I
changed
> > it to:
> >
> >     print pydoc.TextDoc().docmodule(my_extension_module)
> >
> > Now I get (well, I'm not sure how this will show up in your mailer, but
for
> > me it's full of control characters):
>
> In my mailer, X^HX is displayed as a bold X.  It's an old trick of
> impact printers and interpreted by fine unix screen pagers such as
> "less".

Figured it was something like that.

> I'm not sure how to disable it.  However,
>     re.sub("\10.", "", s)
> should remove it from "s" without hurting anything else.  I don't know
> if pydoc produces underlines.  If underlines
> are expressed as X^H_, then it'll convert those to regular text too.
> But if underlines are _^HX, you'll want to use
>     re.sub(".\10", "", s)
> instead.  That'll work for both bold and underline.

I didn't want to resort to that, but then I also thought it would be uglier
than it turned out to be.

Thanks!

-----------------------------------------------------------
           David Abrahams * Boost Consulting
dave@boost-consulting.com * http://www.boost-consulting.com