MCPcopy Create free account
hub / github.com/fastapi/fastapi / iter_all_lang_paths

Function iter_all_lang_paths

scripts/translation_fixer.py:31–53  ·  view source on GitHub ↗

Iterate on the markdown files to translate in order of priority.

(lang_path_root: Path)

Source from the content-addressed store, hash-verified

29
30
31def iter_all_lang_paths(lang_path_root: Path) -> Iterable[Path]:
32 """
33 Iterate on the markdown files to translate in order of priority.
34 """
35
36 first_dirs = [
37 lang_path_root / "learn",
38 lang_path_root / "tutorial",
39 lang_path_root / "advanced",
40 lang_path_root / "about",
41 lang_path_root / "how-to",
42 ]
43 first_parent = lang_path_root
44 yield from first_parent.glob("*.md")
45 for dir_path in first_dirs:
46 yield from dir_path.rglob("*.md")
47 first_dirs_str = tuple(str(d) for d in first_dirs)
48 for path in lang_path_root.rglob("*.md"):
49 if str(path).startswith(first_dirs_str):
50 continue
51 if path.parent == first_parent:
52 continue
53 yield path
54
55
56def get_all_paths(lang: str):

Callers 1

get_all_pathsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected