Find all source files in the source dir and put them in self.found_docs.
(self, config: Config, builder: Builder)
| 483 | return self.project.docnames |
| 484 | |
| 485 | def find_files(self, config: Config, builder: Builder) -> None: |
| 486 | """Find all source files in the source dir and put them in |
| 487 | self.found_docs. |
| 488 | """ |
| 489 | try: |
| 490 | exclude_paths = ( |
| 491 | self.config.exclude_patterns |
| 492 | + self.config.templates_path |
| 493 | + builder.get_asset_paths() |
| 494 | ) |
| 495 | self.project.discover(exclude_paths, self.config.include_patterns) |
| 496 | |
| 497 | # Current implementation is applying translated messages in the reading |
| 498 | # phase.Therefore, in order to apply the updated message catalog, it is |
| 499 | # necessary to re-process from the reading phase. Here, if dependency |
| 500 | # is set for the doc source and the mo file, it is processed again from |
| 501 | # the reading phase when mo is updated. In the future, we would like to |
| 502 | # move i18n process into the writing phase, and remove these lines. |
| 503 | if builder.use_message_catalog: |
| 504 | # add catalog mo file dependency |
| 505 | repo = CatalogRepository( |
| 506 | self.srcdir, |
| 507 | self.config.locale_dirs, |
| 508 | self.config.language, |
| 509 | self.config.source_encoding, |
| 510 | ) |
| 511 | mo_paths = {c.domain: c.mo_path for c in repo.catalogs} |
| 512 | for docname in self.found_docs: |
| 513 | domain = docname_to_domain(docname, self.config.gettext_compact) |
| 514 | if domain in mo_paths: |
| 515 | self.note_dependency(mo_paths[domain], docname=docname) |
| 516 | except OSError as exc: |
| 517 | raise DocumentError( |
| 518 | __('Failed to scan documents in %s: %r') % (self.srcdir, exc) |
| 519 | ) from exc |
| 520 | |
| 521 | def get_outdated_files( |
| 522 | self, config_changed: bool |