8000 Script to easily create issues on GH · python/python-docs-es@fc7df80 · GitHub
[go: up one dir, main page]

Skip to content

Commit fc7df80

Browse files
committed
Script to easily create issues on GH
1 parent cc9012d commit fc7df80

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

scripts/create_issue.py

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

0 commit comments

Comments
 (0)
0