]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/wx/tools/helpviewer.py
1 #----------------------------------------------------------------------
2 # Name: wxPython.tools.helpviewer
3 # Purpose: HTML Help viewer
9 # Copyright: (c) 2002 by Total Control Software
10 # Licence: wxWindows license
11 #----------------------------------------------------------------------
14 helpviewer.py -- Displays HTML Help in a wxHtmlHelpController window.
17 helpviewer [--cache=path] helpfile [helpfile(s)...]
19 Where helpfile is the path to either a .hhp file or a .zip file
20 which contians a .hhp file. The .hhp files are the same as those
21 used by Microsoft's HTML Help Workshop for creating CHM files.
27 #---------------------------------------------------------------------------
29 def main(args
=sys
.argv
):
36 if args
[0][:7] == '--cache':
37 cachedir
= os
.path
.expanduser(args
[0].split('=')[1])
44 from wxPython
.wx
import wxPySimpleApp
, wxConfigBase_Get
, \
45 wxLog_SetActiveTarget
, wxLogStderr
, \
46 wxLog_SetLogLevel
, wxLOG_Error
, \
47 wxFileSystem_AddHandler
, wxZipFSHandler
49 from wxPython
.htmlhelp
import wxHtmlHelpController
53 #wxLog_SetActiveTarget(wxLogStderr())
54 wxLog_SetLogLevel(wxLOG_Error
)
56 # Set up the default config so the htmlhelp frame can save its preferences
57 app
.SetVendorName('wxWindows')
58 app
.SetAppName('helpviewer')
59 cfg
= wxConfigBase_Get()
61 # Add the Zip filesystem
62 wxFileSystem_AddHandler(wxZipFSHandler())
65 helpctrl
= wxHtmlHelpController()
67 helpctrl
.SetTempDir(cachedir
)
71 print "Adding %s..." % helpfile
72 helpctrl
.AddBook(helpfile
, 1)
75 helpctrl
.DisplayContents()
79 if __name__
== '__main__':