Script to build wxPythonDocs tarball

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@18271 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2002-12-16 21:02:00 +00:00
parent 7ae404f97a
commit 8a243ef08e
5 changed files with 110 additions and 4 deletions

View File

@@ -54,7 +54,7 @@ Added Throbber from Cliff Wells to the library and the demo.
Windows installer prompts to uninstall old version first.
Added wxPython.lib.evtmgr by Rob Shecter, which is an easier, more
Added wxPython.lib.evtmgr by Robb Shecter, which is an easier, more
"Pythonic" and more OO method of registering handlers for wxWindows
events using the Publish/Subscribe pattern.
@@ -70,6 +70,10 @@ implementation of allowing the user to split a window any number of
times either horizontally or vertically, and to close the split off
windows when desired.
Added helpviewer tool that displays HTML books similarly to how MS
HTMLHelp viewer does. Changed how the wxPythonDocs tarball is built
and added a script to launch the doc viewer.

View File

@@ -0,0 +1,16 @@
wxPythonDocs
------------
The wxWindows docs can now be viewed on non-Win32 platforms with a
nice viewer modeled after the MS HTMLViewer. Simply execute the
viewdocs.py script located in this directory and you're all set.
(You'll need to first have wxPython installed and accessible via the
PYTHONPATH.)
You can also add other HTML books to be displayed by the viewer simply
by dropping their .zip file here and tweaking viewdocs.py. The zip
file just needs to contain a .hhp file that defines the contents of
the book. See the docs on wxHtmlHelpController for details.
If you'd still ike to view these docs in your regular browser you can
simply unzip each of the books into their own directory.

61
wxPython/distrib/makedocs Executable file
View File

@@ -0,0 +1,61 @@
#!/bin/bash
#----------------------------------------------------------------------
if [ -z $1 ]; then
echo "Please specify a version number on the command line."
exit 1
fi
if [ ! -d wxPython ]; then # TODO: make this test more robust
echo "Please run this script from the root wxPython directory."
exit 1
fi
# **** Make a directory to build up a distribution tree
mkdir _distrib_bld
mkdir _distrib_bld/wxPythonDocs-$1
cd _distrib_bld
mkdir wxPythonDocs-$1/wx
mkdir wxPythonDocs-$1/ogl
WXDIR=../..
# **** Build the docs using tex2rtf
cp $WXDIR/docs/latex/wx/*.gif wxPythonDocs-$1/wx
$WXDIR/utils/tex2rtf/src/tex2rtf $WXDIR/docs/latex/wx/manual.tex wxPythonDocs-$1/wx/wx.htm -twice -html
cp wxPythonDocs-$1/wx/wx.htm wxPythonDocs-$1/wx/index.htm
cp $WXDIR/contrib/docs/latex/ogl/*.gif wxPythonDocs-$1/ogl
cp $WXDIR/contrib/docs/latex/ogl/*.bmp wxPythonDocs-$1/ogl
$WXDIR/utils/tex2rtf/src/tex2rtf $WXDIR/contrib/docs/latex/ogl/ogl.tex wxPythonDocs-$1/ogl/ogl.htm -twice -html
cp wxPythonDocs-$1/ogl/ogl.htm wxPythonDocs-$1/ogl/index.htm
# **** zip the docs into "books"
cd wxPythonDocs-$1
cd wx
zip ../wx.zip *
cd ..
rm -r wx
cd ogl
zip ../ogl.zip *
cd ..
rm -r ogl
cd ..
cp ../distrib/viewdocs.py wxPythonDocs-$1
cp ../distrib/README.viewdocs.txt wxPythonDocs-$1/README.txt
rm -f ../dist/wxPythonDocs-$1.tar.gz
tar cvf ../dist/wxPythonDocs-$1.tar wxPythonDocs-$1
gzip -9 ../dist/wxPythonDocs-$1.tar
# **** Cleanup
cd ..
rm -r _distrib_bld

25
wxPython/distrib/viewdocs.py Executable file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env python
#---------------------------------------------------------------------------
import sys, os
from wxPython.tools import helpviewer
# Figure out the path where this app is located
if __name__ == '__main__':
basePath = os.path.dirname(sys.argv[0])
else:
basePath = os.path.dirname(__file__)
# setup the args
args = ['',
'--cache='+basePath,
os.path.join(basePath, 'wx.zip'),
os.path.join(basePath, 'ogl.zip'),
]
# launch helpviewer
helpviewer.main(args)
#---------------------------------------------------------------------------

View File

@@ -26,12 +26,12 @@ import sys, os
#---------------------------------------------------------------------------
def main():
if len(sys.argv) < 2:
def main(args=sys.argv):
if len(args) < 2:
print __doc__
return
args = sys.argv[1:]
args = args[1:]
cachedir = None
if args[0][:7] == '--cache':
cachedir = os.path.expanduser(args[0].split('=')[1])