mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
merge with 0.6
This commit is contained in:
commit
7d56682ad7
3
CHANGES
3
CHANGES
@ -28,6 +28,9 @@ Release 1.0 (in development)
|
||||
Release 0.6.2 (in development)
|
||||
==============================
|
||||
|
||||
* #196: Add a warning if an extension module doesn't have a
|
||||
``setup()`` function.
|
||||
|
||||
* #158: Allow '..' in template names, and absolute template paths;
|
||||
Jinja 2 by default disables both.
|
||||
|
||||
|
@ -23,8 +23,8 @@ This section is intended to collect helpful hints for those wanting to migrate
|
||||
to reStructuredText/Sphinx from other documentation systems.
|
||||
|
||||
* Gerard Flanagan has written a script to convert pure HTML to reST; it can be
|
||||
found at `Launchpad
|
||||
<http://bazaar.launchpad.net/~grflanagan/python-rattlebag/trunk/annotate/head:/src/html2rest.py>`_.
|
||||
found at `BitBucket
|
||||
<http://bitbucket.org/djerdo/musette/src/tip/musette/html/html2rest.py>`_.
|
||||
|
||||
* For converting the old Python docs to Sphinx, a converter was written which
|
||||
can be found at `the Python SVN repository
|
||||
|
@ -167,7 +167,10 @@ class Sphinx(object):
|
||||
except ImportError, err:
|
||||
raise ExtensionError('Could not import extension %s' % extension,
|
||||
err)
|
||||
if hasattr(mod, 'setup'):
|
||||
if not hasattr(mod, 'setup'):
|
||||
self.warn('extension %r has no setup() function; is it really '
|
||||
'a Sphinx extension module?' % extension)
|
||||
else:
|
||||
mod.setup(self)
|
||||
self._extensions[extension] = mod
|
||||
|
||||
|
@ -509,8 +509,12 @@ class StandaloneHTMLBuilder(Builder):
|
||||
ensuredir(path.join(self.outdir, '_images'))
|
||||
for src, dest in self.images.iteritems():
|
||||
self.info(' '+src, nonl=1)
|
||||
copyfile(path.join(self.srcdir, src),
|
||||
path.join(self.outdir, '_images', dest))
|
||||
try:
|
||||
copyfile(path.join(self.srcdir, src),
|
||||
path.join(self.outdir, '_images', dest))
|
||||
except Exception, err:
|
||||
self.warn('cannot copy image file %r: %s' %
|
||||
(path.join(self.srcdir, src), err))
|
||||
self.info()
|
||||
|
||||
# copy downloadable files
|
||||
@ -519,8 +523,12 @@ class StandaloneHTMLBuilder(Builder):
|
||||
ensuredir(path.join(self.outdir, '_downloads'))
|
||||
for src, (_, dest) in self.env.dlfiles.iteritems():
|
||||
self.info(' '+src, nonl=1)
|
||||
copyfile(path.join(self.srcdir, src),
|
||||
path.join(self.outdir, '_downloads', dest))
|
||||
try:
|
||||
copyfile(path.join(self.srcdir, src),
|
||||
path.join(self.outdir, '_downloads', dest))
|
||||
except Exception, err:
|
||||
self.warn('cannot copy downloadable file %r: %s' %
|
||||
(path.join(self.srcdir, src), err))
|
||||
self.info()
|
||||
|
||||
# copy static files
|
||||
|
@ -57,3 +57,13 @@ def test_output():
|
||||
assert app._warncount == old_count + 1
|
||||
finally:
|
||||
app.cleanup()
|
||||
|
||||
|
||||
def test_extensions():
|
||||
status, warnings = StringIO(), StringIO()
|
||||
app = TestApp(status=status, warning=warnings)
|
||||
try:
|
||||
app.setup_extension('shutil')
|
||||
assert warnings.getvalue().startswith("WARNING: extension 'shutil'")
|
||||
finally:
|
||||
app.cleanup()
|
||||
|
Loading…
Reference in New Issue
Block a user