Remove unused files from the HTML help build.

This commit is contained in:
Georg Brandl 2008-05-03 20:45:43 +00:00
parent 78812d8e7c
commit 9b5566dddb
2 changed files with 7 additions and 5 deletions

View File

@ -468,6 +468,7 @@ class StandaloneHTMLBuilder(Builder):
self.handle_page('modindex', modindexcontext, 'modindex.html')
# the search page
if self.name != 'htmlhelp':
self.info(' search', nonl=1)
self.handle_page('search', {}, 'search.html')
@ -476,7 +477,7 @@ class StandaloneHTMLBuilder(Builder):
self.info(' '+pagename, nonl=1)
self.handle_page(pagename, {}, template)
if self.config.html_use_opensearch:
if self.config.html_use_opensearch and self.name != 'htmlhelp':
self.info(' opensearch', nonl=1)
fn = path.join(self.outdir, '_static', 'opensearch.xml')
self.handle_page('opensearch', {}, 'opensearch.xml', outfilename=fn)

View File

@ -135,9 +135,10 @@ def build_hhx(builder, outdir, outname):
outdir += os.sep
olen = len(outdir)
for root, dirs, files in os.walk(outdir):
staticdir = (root == path.join(outdir, '_static'))
for fn in files:
if fn.endswith('.html') or fn.endswith('.css') or fn.endswith('.js'):
print >>f, path.join(root, fn)[olen:].replace('/', '\\')
if (staticdir and not fn.endswith('.js')) or fn.endswith('.html'):
print >>f, path.join(root, fn)[olen:].replace(os.sep, '\\')
finally:
f.close()