[Tutor] PYTHONDOCS & Html Documentation

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Fri, 15 Jun 2001 11:27:16 -0700 (PDT)


On Fri, 15 Jun 2001, Fred Allen wrote:

> downloaded Python 2.1 HTML Documentation (15 April 2001), a 2008 Kb ZIP
> file and extracted its 's contents into C:\Python21\Docs\Html, yielding
> 10 subdirectories, viz: api, dist, doc, ext, icons, inst, lib, mac, ref,
> and tut.  I assume, but am by no means sure, this was the intention of

Sounds good!  Your PYTHONDOCS variable should then say:

    C:\Python21\Docs\Html


> I've also tried assigning PYTHONDOCS only the value
> =93C:\Python21\Docs\Html=94, the name of the expanded documentations top

Oh.

> So does it now, despite the environment variable's now explicitly
> citing every subdirectory.  I attempted expressing PYTHONDOCS
> directories in Pythonese (e.g., as arrays of strings).  All to no
> avail.

Ah!  Ok, you won't need to put every directory; the base directory is the
only one you'll need.  I think that pydoc expects PYTHONDOCS to name only
one directory.

Let me check.  Within the pydoc source code, there's one place where pydoc
uses PYTHONDOCS:

###
## within pydoc.Helper.__init__
       for dir in [os.environ.get('PYTHONDOCS'),
                # [dyoo: complicated paths removed to make
                #  explanation more simple]
            if dir and os.path.isdir(os.path.join(dir, 'lib')):
                self.docdir =3D dir
###

Basically, the code here says that it expects PYTHONDOCS to name a single
base directory --- it'll attach the subdirectory name 'lib' to it, and
then pydoc will be happy.

So the problem was adding too much to PYTHONDOCS.  Hope this helps!