Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Finucane <stephen@that.guru>2018-01-21 15:42:27 +0300
committerAdam Turner <9087854+AA-Turner@users.noreply.github.com>2022-09-26 19:50:57 +0300
commit9ab21ce51aa7cb6a3351ba7ffdde7a3ea368e8cf (patch)
tree0f1dd45452a7cb3146b9b482d7aa61e4443140bf
parent6adbb006f9fa342297bc67b9f8496ea667eede95 (diff)
Combine 'compile_xxx' and 'build_xxx' functions
These are only called from the one location and we already use 'build' to do both building and writing. Given that we intend to simplify the handling of the 'filenames' argument, this makes our lives there much easier. Signed-off-by: Stephen Finucane <stephen@that.guru>
-rw-r--r--sphinx/application.py3
-rw-r--r--sphinx/builders/__init__.py7
2 files changed, 7 insertions, 3 deletions
diff --git a/sphinx/application.py b/sphinx/application.py
index 10c03a268..7b43b933e 100644
--- a/sphinx/application.py
+++ b/sphinx/application.py
@@ -340,13 +340,10 @@ class Sphinx:
self.phase = BuildPhase.READING
try:
if force_all:
- self.builder.compile_all_catalogs()
self.builder.build_all()
elif filenames:
- self.builder.compile_specific_catalogs(filenames)
self.builder.build_specific(filenames)
else:
- self.builder.compile_update_catalogs()
self.builder.build_update()
self.events.emit('build-finished', None)
diff --git a/sphinx/builders/__init__.py b/sphinx/builders/__init__.py
index caf0ed567..fdb5fabfa 100644
--- a/sphinx/builders/__init__.py
+++ b/sphinx/builders/__init__.py
@@ -252,6 +252,7 @@ class Builder:
message = __('targets for %d po files that are specified') % len(catalogs)
self.compile_catalogs(catalogs, message)
+ # TODO(stephenfin): This would make more sense as 'compile_outdated_catalogs'
def compile_update_catalogs(self) -> None:
repo = CatalogRepository(self.srcdir, self.config.locale_dirs,
self.config.language, self.config.source_encoding)
@@ -263,6 +264,8 @@ class Builder:
def build_all(self) -> None:
"""Build all source files."""
+ self.compile_all_catalogs()
+
self.build(None, summary=__('all source files'), method='all')
def build_specific(self, filenames: List[str]) -> None:
@@ -290,11 +293,15 @@ class Builder:
docnames.append(docname)
+ self.compile_specific_catalogs(filenames)
+
self.build(docnames, method='specific',
summary=__('%d source files given on command line') % len(docnames))
def build_update(self) -> None:
"""Only rebuild what was changed or added since last build."""
+ self.compile_update_catalogs()
+
to_build = self.get_outdated_docs()
if isinstance(to_build, str):
self.build(['__all__'], to_build)