Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7e19c40

Browse files
committed
Handle lang_dir in stats.py
1 parent2762541 commit7e19c40

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

‎scripts/stats.py‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,16 @@
1717

1818
defmain()->None:
1919
"""Main function to generate translation stats."""
20-
language=os.environ.get("PYDOC_LANGUAGE")
21-
ifnotlanguage:
22-
raiseValueError("Environment variable PYDOC_LANGUAGE is not set.")
2320

24-
pofiles_path=Path(f"cpython/Doc/locales/{language}/LC_MESSAGES")
21+
lang_dir=os.environ.get("PYDOC_LANG_DIR")
22+
iflang_dir:
23+
pofiles_path=lang_dir
24+
else:
25+
language=os.environ.get("PYDOC_LANGUAGE")
26+
ifnotlanguage:
27+
raiseValueError("Environment variable PYDOC_LANGUAGE is not set.")
28+
pofiles_path=Path(f"cpython/Doc/locales/{language}/LC_MESSAGES")
29+
2530
ifnotpofiles_path.exists():
2631
raiseFileNotFoundError(f"Path does not exist:{pofiles_path}")
2732

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp