mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
merge with stable
This commit is contained in:
commit
25b3d4a9b6
@ -21,6 +21,8 @@ import sys
|
|||||||
import optparse
|
import optparse
|
||||||
from os import path
|
from os import path
|
||||||
|
|
||||||
|
from sphinx.util.osutil import walk
|
||||||
|
|
||||||
# automodule options
|
# automodule options
|
||||||
if 'SPHINX_APIDOC_OPTIONS' in os.environ:
|
if 'SPHINX_APIDOC_OPTIONS' in os.environ:
|
||||||
OPTIONS = os.environ['SPHINX_APIDOC_OPTIONS'].split(',')
|
OPTIONS = os.environ['SPHINX_APIDOC_OPTIONS'].split(',')
|
||||||
@ -185,7 +187,7 @@ def recurse_tree(rootpath, excludes, opts):
|
|||||||
toplevels = []
|
toplevels = []
|
||||||
followlinks = getattr(opts, 'followlinks', False)
|
followlinks = getattr(opts, 'followlinks', False)
|
||||||
includeprivate = getattr(opts, 'includeprivate', False)
|
includeprivate = getattr(opts, 'includeprivate', False)
|
||||||
for root, subs, files in os.walk(rootpath, followlinks=followlinks):
|
for root, subs, files in walk(rootpath, followlinks=followlinks):
|
||||||
# document only Python module files (that aren't excluded)
|
# document only Python module files (that aren't excluded)
|
||||||
py_files = sorted(f for f in files
|
py_files = sorted(f for f in files
|
||||||
if path.splitext(f)[1] in PY_SUFFIXES and
|
if path.splitext(f)[1] in PY_SUFFIXES and
|
||||||
|
@ -405,7 +405,10 @@ class HTMLTranslator(BaseTranslator):
|
|||||||
node['width'] = str(im.size[0])
|
node['width'] = str(im.size[0])
|
||||||
if 'height' not in node:
|
if 'height' not in node:
|
||||||
node['height'] = str(im.size[1])
|
node['height'] = str(im.size[1])
|
||||||
del im
|
try:
|
||||||
|
im.fp.close()
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
BaseTranslator.visit_image(self, node)
|
BaseTranslator.visit_image(self, node)
|
||||||
|
|
||||||
def visit_toctree(self, node):
|
def visit_toctree(self, node):
|
||||||
|
Loading…
Reference in New Issue
Block a user