websupport: adapt builder to changes in html builder due to parallel building API

This commit is contained in:
Georg Brandl 2013-03-29 18:57:28 +01:00
parent 71360bcac6
commit 937a93887f
2 changed files with 9 additions and 4 deletions

View File

@ -56,20 +56,25 @@ class WebSupportBuilder(PickleHTMLBuilder):
destination = StringOutput(encoding='utf-8')
doctree.settings = self.docsettings
self.cur_docname = docname
self.secnumbers = self.env.toc_secnumbers.get(docname, {})
self.imgpath = '/' + posixpath.join(self.virtual_staticdir, '_images')
self.post_process_images(doctree)
self.dlpath = '/' + posixpath.join(self.virtual_staticdir, '_downloads')
self.current_docname = docname
self.docwriter.write(doctree, destination)
self.docwriter.assemble_parts()
body = self.docwriter.parts['fragment']
metatags = self.docwriter.clean_meta
ctx = self.get_doc_context(docname, body, metatags)
self.index_page(docname, doctree, ctx.get('title', ''))
self.handle_page(docname, ctx, event_arg=doctree)
def write_doc_serialized(self, docname, doctree):
self.imgpath = '/' + posixpath.join(self.virtual_staticdir, '_images')
self.post_process_images(doctree)
title = self.env.longtitles.get(docname)
title = title and self.render_partial(title)['title'] or ''
self.index_page(docname, doctree, title)
def load_indexer(self, docnames):
self.indexer = self.search
self.indexer.init_indexing(changed=docnames)

View File

@ -42,5 +42,5 @@ class WebSupportTranslator(HTMLTranslator):
storage = self.builder.storage
if not storage.has_node(node.uid):
storage.add_node(id=node.uid,
document=self.builder.cur_docname,
document=self.builder.current_docname,
source=node.rawsource or node.astext())