Generate an HTML Help file and include it in the build.

This commit is contained in:
Raoul Snyman 2011-04-02 22:09:49 +02:00
parent 107dc01c4b
commit 67b087fe4a

View File

@ -94,6 +94,8 @@ from subprocess import Popen, PIPE
python_exe = sys.executable python_exe = sys.executable
innosetup_exe = os.path.join(os.getenv(u'PROGRAMFILES'), 'Inno Setup 5', innosetup_exe = os.path.join(os.getenv(u'PROGRAMFILES'), 'Inno Setup 5',
u'ISCC.exe') u'ISCC.exe')
sphinx_exe = os.path.join(os.path.split(python_exe)[0], u'Scripts',
u'sphinx-build.exe')
hhc_exe = os.path.join(os.getenv(u'PROGRAMFILES'), 'HTML Help Workshop', hhc_exe = os.path.join(os.getenv(u'PROGRAMFILES'), 'HTML Help Workshop',
u'hhc.exe') u'hhc.exe')
@ -246,7 +248,8 @@ def compile_translations():
def run_sphinx(): def run_sphinx():
print u'Running Sphinx...' print u'Running Sphinx...'
os.chdir(manual_path) os.chdir(manual_path)
sphinx = Popen((u'make', u'htmlhelp'), stdout=PIPE) sphinx = Popen((sphinx_exe, u'-b', u'htmlhelp', u'-d', u'build/doctrees',
u'source', u'build/htmlhelp'), stdout=PIPE)
output, error = sphinx.communicate() output, error = sphinx.communicate()
code = sphinx.wait() code = sphinx.wait()
if code != 0: if code != 0:
@ -259,7 +262,8 @@ def run_htmlhelp():
hhc = Popen((hhc_exe, u'OpenLP.chm'), stdout=PIPE) hhc = Popen((hhc_exe, u'OpenLP.chm'), stdout=PIPE)
output, error = hhc.communicate() output, error = hhc.communicate()
code = hhc.wait() code = hhc.wait()
if code != 0: if code != 1:
print u'Exit code:', code
print output print output
raise Exception(u'Error running HTML Help Workshop') raise Exception(u'Error running HTML Help Workshop')
else: else: