diff options
| author | Georg Brandl <georg@python.org> | 2013-01-13 19:46:34 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2013-01-13 19:46:34 +0100 |
| commit | 439f20840545ff119daed5264eac3d5523f7a143 (patch) | |
| tree | 18e01e10bbc543a01e626d2d069a7c04c52b04f2 /sphinx/builders/html.py | |
| parent | 8da1994fc032d446fb7011193e2fab99500a5c15 (diff) | |
| download | sphinx-439f20840545ff119daed5264eac3d5523f7a143.tar.gz | |
builder: fix parallel build globals problems by splitting write_doc in two
stages: write_doc() and write_doc_serialized(), the latter of which is not
called in the parallel processes.
This costs speedup, of course: from about 50% we are down to about 30%
improvement on my 4-core machine.
Diffstat (limited to 'sphinx/builders/html.py')
| -rw-r--r-- | sphinx/builders/html.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py index 4c700c8a..32376333 100644 --- a/sphinx/builders/html.py +++ b/sphinx/builders/html.py @@ -415,7 +415,6 @@ class StandaloneHTMLBuilder(Builder): self.secnumbers = self.env.toc_secnumbers.get(docname, {}) self.imgpath = relative_uri(self.get_target_uri(docname), '_images') - self.post_process_images(doctree) self.dlpath = relative_uri(self.get_target_uri(docname), '_downloads') self.current_docname = docname self.docwriter.write(doctree, destination) @@ -424,9 +423,15 @@ class StandaloneHTMLBuilder(Builder): 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 = relative_uri(self.get_target_uri(docname), '_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 finish(self): self.info(bold('writing additional files...'), nonl=1) |
