MCPcopy
hub / github.com/sphinx-doc/sphinx / find_files

Method find_files

sphinx/environment/__init__.py:485–519  ·  view source on GitHub ↗

Find all source files in the source dir and put them in self.found_docs.

(self, config: Config, builder: Builder)

Source from the content-addressed store, hash-verified

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

Callers 13

_post_init_envMethod · 0.80
readMethod · 0.80
test_toctreeFunction · 0.80
test_relative_toctreeFunction · 0.80
test_toctree_globFunction · 0.80
test_reversed_toctreeFunction · 0.80
test_toctree_classFunction · 0.80
test_toctree_twiceFunction · 0.80

Calls 6

note_dependencyMethod · 0.95
CatalogRepositoryClass · 0.90
docname_to_domainFunction · 0.90
DocumentErrorClass · 0.90
discoverMethod · 0.80
get_asset_pathsMethod · 0.45

Tested by 11

test_toctreeFunction · 0.64
test_relative_toctreeFunction · 0.64
test_toctree_globFunction · 0.64
test_reversed_toctreeFunction · 0.64
test_toctree_classFunction · 0.64
test_toctree_twiceFunction · 0.64
_get_update_targetsFunction · 0.64