[Idle-dev] Windows Helpfiles
Kurt B. Kaiser
kbk@shore.net
06 Jan 2003 14:25:06 -0500
"Hernan Martinez Foffani" <hernan@orgmf.com.ar> writes:
> [Guido]
> >> pythlp.chm is a 3rd party add-on; it was never distributed as part of
> >> Python for Windows, and probably never will (keeping it up to date
> >> proved too much of a hassle). But as long as it is available as a
> >> 3rd party add-on, I see no reason why IDLE couldn't look for it and
> >> add a help item for it if it exists.
>
> [Bruce]
> > Hmm. What's the criterion for such a search? Is it possible that IDLE
> > could look for the reference manual for the visual module? It is in
> > the form of a folder named "visual" with a bunch of html files, and
> > the starting location is "index.html". Obviously it should be
> > searched for only if the visual module exists.
>
> the patch, if I remember correctly, look for a file named 'pythlp.chm'
> under the Python directory. if it's there it use that file as a
> the python docs and it's open using os.startfile(). if it's not there
> the standard Doc/index.html is triggered thru webbrowser.open()
The patch was in fact applied to Python IDLE. It only pertains to
Windows, i.e. it looks for the win platform. If IDLE can't find
pythlp.chm in the Python directory, it looks for index.html in the
Python/Doc directory. (I am fixing IDLEfork so this works when IDLE
is installed under site-packages). On Windows, the resulting path is
opened via os.startfile(). webbrowser.open() is used on other
platforms.
I can arrange the Extra Help facility so that on Windows the path is
opened with os.startfile().
It would be best not to special case IDLE for every possible help
file/url. That's what the Extra Help facility is for.
Bruce, to answer your earlier question, the .idlerc directory is
created in the user's home directory on Linux, and currently at c:\ in
Windows. It contains all the customizations that the user has made
using the Settings dialog (and also his breakpoints). So it would be
easy for you to set up a machine the way you want it and then
propagate the .idlerc (possibly deleting the breakpoints.lst and
recent-files.lst) to your students. With a little scripting, you
could also switch .idlerc files on the fly for your demonstrations
(e.g. use different font sizes). The Extra Help locations live in the
[Help Files] section of .idlerc/config-main.cfg, so they will also be
propagated. You could even propagate daily so the Extra Help would
contain the day's Lab Instructions and the Recent Files List contains
the day's examples.
Anything not customized uses the defaults in the .def files.
--
KBK