Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork40
Listar arquivo PO obsoletos#136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
9 commits Select commitHold shift + click to select a range
bba4914
Create list-obsolete.py
rffontenellef18dad7
Add list-obsolete job to check.yml
rffontenelledf4b85c
Add list-obsolete.py to the list of path triggers in check.yml
rffontenelle74ec886
Quit with error when at least one file from list-obsolete.py
rffontenelle2ab0f65
Rename .github/prepmsg.sh to .github/scripts/prepmsg.sh
rffontenelle76da4d6
prepmsg.sh is now in scripts dir - check.yml
rffontenellefce8614
Make list-obsolete.py an executable
rffontenelle611c7f1
Remove obsolete files
rffontenelleb1d4ea4
Remove install/index.po
rffontenelleFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
44 changes: 44 additions & 0 deletions.github/scripts/list-obsolete.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env python3 | ||
# List PO files that no longer have a corresponding page in Python docs | ||
import os | ||
import os.path | ||
import sys | ||
import subprocess | ||
def run(cmd): | ||
return subprocess.check_output(cmd, shell=True, text=True) | ||
# Set POT root directory from command-line argument or hardcoded, then test it | ||
pot_root = 'cpython/Doc/locales/pot/' | ||
if len(sys.argv) > 1: | ||
pot_root = sys.argv[0] | ||
if not os.path.isdir(pot_root): | ||
print(f'Unable to find the POT directory {pot_root}') | ||
exit(1) | ||
# List PO files tracked by git | ||
po_files = run('git ls-files | grep .po | tr "\n" " "').split() | ||
# Compare po vs pot, store po without corresponding pot | ||
to_remove = [] | ||
for file in sorted(po_files): | ||
pot = os.path.join(pot_root, file + 't') | ||
if not os.path.isfile(pot): | ||
to_remove.append(file) | ||
# Exit if no obsolete, or print obsoletes files. | ||
# If running in GitHub Actions, add a problem matcher to bring up the attention | ||
if len(to_remove) == 0: | ||
exit | ||
else: | ||
matcher = "" | ||
if 'CI' in os.environ: | ||
matcher = '::error::' | ||
print(f'{matcher}The following files are absent in the documentation, hence they should be removed:\n') | ||
for file in to_remove: | ||
print(f'{matcher} ' + file) | ||
print("") | ||
exit(1) |
File renamed without changes.
26 changes: 23 additions & 3 deletions.github/workflows/check.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
35 changes: 0 additions & 35 deletionsdistutils/_setuptools_disclaimer.po
This file was deleted.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.