[wingide-users] How to use ActiveState's Python HTMLHelp file
with Wing IDE
Wingware Support
support at wingware.com
Tue Mar 10 08:37:58 MDT 2009
Thanks. Note that this does depend on python 2.5 being installed with
the win32 extensions in c:\Python25. It can probably be made to work
with ctypes to remove the dependence on the win32 extensions. I mention
this in case someone without these prerequisites wants to use it.
Cheers,
John
Dan Roger wrote:
> Since I'm having trouble getting auto-completion and the Source Assistant
> to reliably work in Wing IDE Pro 3.1.7-1, I made a minor mod to
> Brandon Corfman's hack to add context-sensitive help to Komodo
> (http://mysite.verizon.net/bcorfman/labels/hacks.html) so it
> would work as a WingIDE script instead:
>
> def _showHTMLHelpPage(keywords):
> import sys
> oldSysPath = sys.path
> sys.path.append("C:/Python25/Lib/site-packages/win32")
> import win32help
> # Restore sys.path in case messing with it is a bad idea?
> sys.path = oldSysPath
>
> win32help.HtmlHelp(0, None, win32help.HH_INITIALIZE, None)
> link = win32help.HH_AKLINK()
> link.indexOnFail = 1
> link.keywords = keywords
> link.url = ""
> link.msgText = ""
> link.msgTitle = ""
> link.window = ""
> win32help.HtmlHelp(0, "C:/Python25/Doc/ActivePython25.chm",
> win32help.HH_KEYWORD_LOOKUP, link)
>
> def showActiveStatePythonHelp():
> editor = wingApp.GetActiveEditor()
> doc = editor.GetDocument()
> start, end = editor.GetSelection()
> txt = doc.GetCharRange(start, end)
> _showHTMLHelpPage(txt)
>
> After you bind showActiveStatePythonHelp to, say, Ctrl+H, selecting
> logging and then pressing Ctrl+H will open ActiveState's compiled help
> file for Python to the logging module's documentation.
>
> Depending on the selection, you'll either get right to the page, be
> given a list of choices in a popup menu, or find yourself in the index
> pane at its closest match.
> _________________________________________________
> Wing IDE users list
> http://wingware.com/lists/wingide
More information about the wingide-users
mailing list