The arguments of EpubBuilder.build_container() is deprecated.

This commit is contained in:
Takeshi KOMIYA 2019-01-08 23:45:54 +09:00
parent 0f972e8bbf
commit f000df8bfb
4 changed files with 12 additions and 4 deletions

View File

@ -58,7 +58,8 @@ Deprecated
* Support for evaluating Python 2 syntax is deprecated. This includes
configuration files which should be converted to Python 3.
* The arguments of ``EpubBuilder.build_mimetype()``
* The arguments of ``EpubBuilder.build_mimetype()``,
``EpubBuilder.build_container()``
* The ``encoding`` argument of ``autodoc.Documenter.get_doc()``,
``autodoc.DocstringSignatureMixin.get_doc()``,
``autodoc.DocstringSignatureMixin._find_signature()``, and

View File

@ -242,7 +242,8 @@ The following is a list of deprecated interfaces.
- 4.0
- N/A
* - arguments of ``EpubBuilder.build_mimetype()``
* - arguments of ``EpubBuilder.build_mimetype()``,
``EpubBuilder.build_container()``.
- 2.0
- 4.0
- N/A

View File

@ -485,9 +485,15 @@ class EpubBuilder(StandaloneHTMLBuilder):
copy_asset_file(path.join(self.template_dir, 'mimetype'),
path.join(outdir, outname))
def build_container(self, outdir, outname):
def build_container(self, outdir=None, outname='META-INF/container.xml'):
# type: (str, str) -> None
"""Write the metainfo file META-INF/container.xml."""
if outdir:
warnings.warn('The arguments of EpubBuilder.build_container() is deprecated.',
RemovedInSphinx40Warning, stacklevel=2)
else:
outdir = self.outdir
logger.info(__('writing %s file...'), outname)
filename = path.join(outdir, outname)
ensuredir(path.dirname(filename))

View File

@ -79,7 +79,7 @@ class Epub3Builder(_epub_base.EpubBuilder):
self.validate_config_value()
self.get_toc()
self.build_mimetype()
self.build_container(self.outdir, 'META-INF/container.xml')
self.build_container()
self.build_content(self.outdir, 'content.opf')
self.build_navigation_doc(self.outdir, 'nav.xhtml')
self.build_toc(self.outdir, 'toc.ncx')