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

Commitdb841f3

Browse files
committed
Make script nicer
1 parent0dfb1d5 commitdb841f3

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

‎scripts/create_issue.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,34 @@
11
importos
22
importsys
3+
frompathlibimportPath
34

4-
importpolib
55
fromgithubimportGithub
6-
6+
frompotodo._po_fileimportPoFileStats
77

88
iflen(sys.argv)!=2:
99
print('Specify PO filename')
1010
sys.exit(1)
1111

1212
pofilename=sys.argv[1]
13-
percentage=polib.pofile(pofilename).percent_translated()
13+
pofile=PoFileStats(Path(pofilename))
1414

1515
g=Github(os.environ.get('GITHUB_TOKEN'))
1616

1717
repo=g.get_repo('PyCampES/python-docs-es')
1818
# https://pygithub.readthedocs.io/en/latest/github_objects/Repository.html#github.Repository.Repository.create_issue
1919
issue=repo.create_issue(
2020
title=f'Translate `{pofilename}`',
21-
body=f'''This file is at{percentage}% translated. It needs to reach 100% translated.
21+
body=f'''This needs to reach 100% translated.
22+
23+
Current stats for `{pofilename}`:
24+
25+
- Fuzzy:{pofile.fuzzy_nb}
26+
- Percent translated:{pofile.percent_translated}%
27+
- Entries:{pofile.translated_nb} /{pofile.po_file_size}
28+
- Untranslated:{pofile.untranslated_nb}
2229
2330
Please, comment here if you want this file to be assigned to you and an member will assign it to you as soon as possible, so you can start working on it.
2431
25-
Remember to follow the steps in our [Contributing Guide](https://python-docs-es.readthedocs.io/es/3.7/CONTRIBUTING.html)''',
32+
Remember to follow the steps in our [Contributing Guide](https://python-docs-es.readthedocs.io/page/CONTRIBUTING.html).''',
2633
)
2734
print(f'Issue created at{issue.html_url}')

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp