]>
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])
47 app
= wx
.PySimpleApp()
48 #wx.Log.SetActiveTarget(wx.LogStderr())
49 wx
.Log
.SetLogLevel(wx
.LOG_Error
)
51 # Set up the default config so the htmlhelp frame can save its preferences
52 app
.SetVendorName('wxWindows')
53 app
.SetAppName('helpviewer')
54 cfg
= wx
.ConfigBase
.Get()
56 # Add the Zip filesystem
57 wx
.FileSystem
.AddHandler(wx
.ZipFSHandler())
60 helpctrl
= wx
.html
.HtmlHelpController()
62 helpctrl
.SetTempDir(cachedir
)
66 print "Adding %s..." % helpfile
67 helpctrl
.AddBook(helpfile
, 1)
70 helpctrl
.DisplayContents()
74 if __name__
== '__main__':