Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b933497

Browse files
authored
Merge pull request #88 from PyCampES/script-create-issues
2 parents 92607b0 + b1d75fd commit b933497

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

scripts/create_issue.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import os
2+
import sys
3+
4+
import polib
5+
from github import Github
6+
7+
8+
if len(sys.argv) != 2:
9+
print('Specify PO filename')
10+
sys.exit(1)
11+
12+
pofilename = sys.argv[1]
13+
percentage = polib.pofile(pofilename).percent_translated()
14+
15+
g = Github(os.environ.get('GITHUB_TOKEN'))
16+
17+
repo = g.get_repo('PyCampES/python-docs-es')
18+
# https://pygithub.readthedocs.io/en/latest/github_objects/Repository.html#github.Repository.Repository.create_issue
19+
issue = repo.create_issue(
20+
title=f'Translate `{pofilename}`',
21+
body=f'''This file is at {percentage}% translated. It needs to reach 100% translated.
22+
23+
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.
24+
25+
Remember to follow the steps in our [Contributing Guide](https://python-docs-es.readthedocs.io/es/3.7/CONTRIBUTING.html)''',
26+
)
27+
print(f'Issue created at {issue.html_url}')

0 commit comments

Comments
 (0)