diff options
| author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-01-08 23:45:54 +0900 |
|---|---|---|
| committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-01-09 00:10:36 +0900 |
| commit | f000df8bfb71fe049017e4c0765b954b5c49ae71 (patch) | |
| tree | b6312655daebe0df2afae1f13e74c756eaed8edd | |
| parent | 0f972e8bbfa31af57f8f91c854cf00935adb3a0c (diff) | |
| download | sphinx-git-f000df8bfb71fe049017e4c0765b954b5c49ae71.tar.gz | |
The arguments of EpubBuilder.build_container() is deprecated.
| -rw-r--r-- | CHANGES | 3 | ||||
| -rw-r--r-- | doc/extdev/index.rst | 3 | ||||
| -rw-r--r-- | sphinx/builders/_epub_base.py | 8 | ||||
| -rw-r--r-- | sphinx/builders/epub3.py | 2 |
4 files changed, 12 insertions, 4 deletions
@@ -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 diff --git a/doc/extdev/index.rst b/doc/extdev/index.rst index de2cbc1a0..08ef1cf19 100644 --- a/doc/extdev/index.rst +++ b/doc/extdev/index.rst @@ -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 diff --git a/sphinx/builders/_epub_base.py b/sphinx/builders/_epub_base.py index f20084d23..9d2b88315 100644 --- a/sphinx/builders/_epub_base.py +++ b/sphinx/builders/_epub_base.py @@ -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)) diff --git a/sphinx/builders/epub3.py b/sphinx/builders/epub3.py index a20009017..95512364a 100644 --- a/sphinx/builders/epub3.py +++ b/sphinx/builders/epub3.py @@ -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') |
