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

Function list_outdated

scripts/translate.py:357–376  ·  view source on GitHub ↗
(language: str)

Source from the content-addressed store, hash-verified

355
356@app.command()
357def list_outdated(language: str) -> list[Path]:
358 dir_path = Path(__file__).absolute().parent.parent
359 repo = git.Repo(dir_path)
360
361 outdated_paths: list[Path] = []
362 en_lang_paths = list(iter_en_paths_to_translate())
363 for path in en_lang_paths:
364 lang_path = generate_lang_path(lang=language, path=path)
365 if not lang_path.exists():
366 continue
367 en_commit_datetime = list(repo.iter_commits(paths=path, max_count=1))[
368 0
369 ].committed_datetime
370 lang_commit_datetime = list(repo.iter_commits(paths=lang_path, max_count=1))[
371 0
372 ].committed_datetime
373 if lang_commit_datetime < en_commit_datetime:
374 outdated_paths.append(path)
375 print(outdated_paths)
376 return outdated_paths
377
378
379@app.command()

Callers 1

update_outdatedFunction · 0.85

Calls 3

generate_lang_pathFunction · 0.85
PathClass · 0.50

Tested by

no test coverage detected