Merge pull request #7982 from tk0miya/7840_optimize_bootstrap

Close #7840: i18n: Optimize the dependencies check on bootstrap
This commit is contained in:
Takeshi KOMIYA 2020-07-19 15:11:12 +09:00 committed by GitHub
commit 5850d6b8f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -26,6 +26,7 @@ Features added
* #7745: html: inventory is broken if the docname contains a space
* #7902: html theme: Add a new option :confval:`globaltoc_maxdepth` to control
the behavior of globaltoc in sidebar
* #7840: i18n: Optimize the dependencies check on bootstrap
* #7052: add ``:noindexentry:`` to the Python, C, C++, and Javascript domains.
Update the documentation to better reflect the relationship between this option
and the ``:noindex:`` option.

View File

@ -387,11 +387,11 @@ class BuildEnvironment:
# add catalog mo file dependency
repo = CatalogRepository(self.srcdir, self.config.locale_dirs,
self.config.language, self.config.source_encoding)
mo_paths = {c.domain: c.mo_path for c in repo.catalogs}
for docname in self.found_docs:
domain = docname_to_domain(docname, self.config.gettext_compact)
for catalog in repo.catalogs:
if catalog.domain == domain:
self.dependencies[docname].add(catalog.mo_path)
if domain in mo_paths:
self.dependencies[docname].add(mo_paths[domain])
except OSError as exc:
raise DocumentError(__('Failed to scan documents in %s: %r') %
(self.srcdir, exc)) from exc