|
| 1 | +importos |
| 2 | +importsys |
| 3 | +importsubprocess |
| 4 | +importprint_percentage |
| 5 | + |
| 6 | +fromgithubimportGithub |
| 7 | + |
| 8 | + |
| 9 | +iflen(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}') |