MCPcopy Index your code
hub / github.com/fastapi/fastapi / get_updated_config_content

Function get_updated_config_content

scripts/docs.py:480–510  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

478
479
480def get_updated_config_content() -> dict[str, Any]:
481 config = get_en_config()
482 languages = [{"en": "/"}]
483 new_alternate: list[dict[str, str]] = []
484 # Language names sourced from https://quickref.me/iso-639-1
485 # Contributors may wish to update or change these, e.g. to fix capitalization.
486 language_names_path = Path(__file__).parent / "../docs/language_names.yml"
487 local_language_names: dict[str, str] = yaml.safe_load(
488 language_names_path.read_text(encoding="utf-8")
489 )
490 for lang_path in get_lang_paths():
491 if lang_path.name in {"en", "em"} or not lang_path.is_dir():
492 continue
493 if lang_path.name not in SUPPORTED_LANGS:
494 # Skip languages that are not yet ready
495 continue
496 code = lang_path.name
497 languages.append({code: f"/{code}/"})
498 for lang_dict in languages:
499 code = list(lang_dict.keys())[0]
500 url = lang_dict[code]
501 if code not in local_language_names:
502 print(
503 f"Missing language name for: {code}, "
504 "update it in docs/language_names.yml"
505 )
506 raise typer.Abort()
507 use_name = f"{code} - {local_language_names[code]}"
508 new_alternate.append({"link": url, "name": use_name})
509 config["extra"]["alternate"] = new_alternate
510 return config
511
512
513banner_sponsors_template = """{% for sponsor in banner_sponsors -%}

Callers 2

stage_zensical_docsFunction · 0.85
update_languagesFunction · 0.85

Calls 3

get_en_configFunction · 0.85
get_lang_pathsFunction · 0.85
PathClass · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…