mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
merge in 0.5
This commit is contained in:
commit
6a8b0aa599
5
CHANGES
5
CHANGES
@ -87,6 +87,11 @@ New features added
|
|||||||
Release 0.5.2 (in development)
|
Release 0.5.2 (in development)
|
||||||
==============================
|
==============================
|
||||||
|
|
||||||
|
* #81: Write environment and search index in a manner that is safe
|
||||||
|
from exceptions that occur during dumping.
|
||||||
|
|
||||||
|
* #80: Fix UnicodeErrors when a locale is set with setlocale().
|
||||||
|
|
||||||
|
|
||||||
Release 0.5.1 (Dec 15, 2008)
|
Release 0.5.1 (Dec 15, 2008)
|
||||||
============================
|
============================
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
This module is only kept for API compatibility; new code should
|
This module is only kept for API compatibility; new code should
|
||||||
import these classes directly from the sphinx.builders package.
|
import these classes directly from the sphinx.builders package.
|
||||||
|
|
||||||
:copyright: 2008 by Georg Brandl.
|
:copyright: 2008-2009 by Georg Brandl.
|
||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
Several HTML builders.
|
Several HTML builders.
|
||||||
|
|
||||||
:copyright: 2007-2008 by Georg Brandl, Armin Ronacher.
|
:copyright: 2007-2009 by Georg Brandl, Armin Ronacher.
|
||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -495,11 +495,15 @@ class StandaloneHTMLBuilder(Builder):
|
|||||||
def handle_finish(self):
|
def handle_finish(self):
|
||||||
self.info(bold('dumping search index... '), nonl=True)
|
self.info(bold('dumping search index... '), nonl=True)
|
||||||
self.indexer.prune(self.env.all_docs)
|
self.indexer.prune(self.env.all_docs)
|
||||||
f = open(path.join(self.outdir, self.searchindex_filename), 'wb')
|
searchindexfn = path.join(self.outdir, self.searchindex_filename)
|
||||||
|
# first write to a temporary file, so that if dumping fails, the existing
|
||||||
|
# index won't be overwritten
|
||||||
|
f = open(searchindexfn + '.tmp', 'wb')
|
||||||
try:
|
try:
|
||||||
self.indexer.dump(f, self.indexer_format)
|
self.indexer.dump(f, self.indexer_format)
|
||||||
finally:
|
finally:
|
||||||
f.close()
|
f.close()
|
||||||
|
os.rename(searchindexfn + '.tmp', searchindexfn)
|
||||||
self.info('done')
|
self.info('done')
|
||||||
|
|
||||||
self.info(bold('dumping object inventory... '), nonl=True)
|
self.info(bold('dumping object inventory... '), nonl=True)
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
Global creation environment.
|
Global creation environment.
|
||||||
|
|
||||||
:copyright: 2007-2008 by Georg Brandl.
|
:copyright: 2007-2009 by Georg Brandl.
|
||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -205,7 +205,9 @@ class BuildEnvironment:
|
|||||||
self.set_warnfunc(None)
|
self.set_warnfunc(None)
|
||||||
values = self.config.values
|
values = self.config.values
|
||||||
del self.config.values
|
del self.config.values
|
||||||
picklefile = open(filename, 'wb')
|
# first write to a temporary file, so that if dumping fails, the existing
|
||||||
|
# environment won't be overwritten
|
||||||
|
picklefile = open(filename + '.tmp', 'wb')
|
||||||
# remove potentially pickling-problematic values from config
|
# remove potentially pickling-problematic values from config
|
||||||
for key, val in vars(self.config).items():
|
for key, val in vars(self.config).items():
|
||||||
if key.startswith('_') or \
|
if key.startswith('_') or \
|
||||||
@ -217,6 +219,7 @@ class BuildEnvironment:
|
|||||||
pickle.dump(self, picklefile, pickle.HIGHEST_PROTOCOL)
|
pickle.dump(self, picklefile, pickle.HIGHEST_PROTOCOL)
|
||||||
finally:
|
finally:
|
||||||
picklefile.close()
|
picklefile.close()
|
||||||
|
os.rename(filename + '.tmp', filename)
|
||||||
# reset attributes
|
# reset attributes
|
||||||
self.config.values = values
|
self.config.values = values
|
||||||
self.set_warnfunc(warnfunc)
|
self.set_warnfunc(warnfunc)
|
||||||
|
Loading…
Reference in New Issue
Block a user