afpy / potodo Goto Github PK
View Code? Open in Web Editor NEWThis project has moved to an open-source forge: https://git.afpy.org/AFPy/potodo
License: MIT License
This project has moved to an open-source forge: https://git.afpy.org/AFPy/potodo
License: MIT License
Currently all fuzzies are reported, even those located in commented blocks of outdated translation. That would be great if they were not reported
From @JulienPalard
The print_list
list is confusing and needs to be clarified.
A better name, another implementation to know what folder to print ? we'll see
Add a switch when adding to the buffer to use plural when there's more than a fuzzy in the file
Needed for python/python-docs-fr#1289.
"NotImplementedError: "Windows" is currently not supported."
I don't understand what this variable is. But it looks a good source of "full caches reset", which looks bad to me.
Cache would be stored in like ~/.potodo/cache.json
, and it would contain the last refresh date and refresh every month or something ? The reservations would still be updated everytime the command is ran
show no fuzzys
find the culprit, or add a .potodoignore
That would be great to create the issue from the CLI.
From @JulienPalard
Some of our translator still have python 3.5 and then can't use polib. If you don't feel like to do it, I can do it. If so, assign it to me
From @JulienPalard
For instance, glossary.po does not appear reserved ATM.
With the following traceback:
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/antoine/github/Potodo/potodo/__main__.py", line 3, in <module>
__import__("potodo.potodo").potodo.main()
File "/home/antoine/github/Potodo/potodo/potodo.py", line 305, in main
exec_potodo(**vars(args))
TypeError: exec_potodo() got an unexpected keyword argument 'json'
[
{
"name": "folder/",
"percent_translated": 0.0,
"files": [
{
"name": "folder/file3",
"path": "some/path/folder/file3.po",
"entries": 1,
"fuzzies": 0,
"translated": 0,
"percent_translated": 0,
"reserved_by": null,
},
],
},
{
"name": "python-docs-fr/",
"percent_translated": 25,
"files": [
{
"name": "python-docs-fr/file1",
"path": "some/path/file1.po",
"entries": 3,
"fuzzies": 1,
"translated": 1,
"percent_translated": 33,
"reserved_by": null,
},
{
"name": "python-docs-fr/file2",
"path": "some/path/file2.po",
"entries": 1,
"fuzzies": 0,
"translated": 0,
"percent_translated": 0,
"reserved_by": null,
},
],
},
]
Il y a 2-3 trucs à améliorer sur la sortie ;
Originally posted by @awecx in #45 (comment)
EDIT 31/12/20, percent_translated sur les dossiers correct.
EDIT 04/01/21, entries », « fuzzies », « translated » aggrégés.
Also relevant for #21
Using the repository: https://github.com/raulcd/python-docs-es
And the command: potodo --offline --path c-api/
I find strange results in c-api:
# c-api (47.03% done)
- abstract.po 3 / 3 (100.0% translated)
- allocation.po 9 / 9 (100.0% translated)
- apiabiversion.po 22 / 22 (100.0% translated)
- arg.po 0 / 192 ( 0.0% translated)
- bool.po 8 / 8 (100.0% translated)
- buffer.po 0 / 102 ( 0.0% translated)
- bytearray.po 17 / 17 (100.0% translated)
- bytes.po 0 / 60 ( 0.0% translated)
- capsule.po 0 / 29 ( 0.0% translated)
- cell.po 10 / 10 (100.0% translated)
- code.po 9 / 9 (100.0% translated)
- codec.po 0 / 27 ( 0.0% translated)
- complex.po 0 / 25 ( 0.0% translated)
- concrete.po 11 / 11 (100.0% translated)
- contextvars.po 0 / 31 ( 0.0% translated)
- conversion.po 22 / 27 ( 81.0% translated), 5 fuzzy
- coro.po 0 / 6 ( 0.0% translated)
- datetime.po 0 / 41 ( 0.0% translated)
- descriptor.po 4 / 4 (100.0% translated)
- dict.po 0 / 31 ( 0.0% translated)
- exceptions.po 0 / 261 ( 0.0% translated)
- file.po 0 / 15 ( 0.0% translated)
- float.po 14 / 14 (100.0% translated)
- function.po 18 / 18 (100.0% translated)
- gcsupport.po 0 / 25 ( 0.0% translated)
- gen.po 8 / 8 (100.0% translated)
- import.po 0 / 44 ( 0.0% translated)
- index.po 2 / 2 (100.0% translated)
- init.po 0 / 287 ( 0.0% translated)
- init_config.po 0 / 274 ( 0.0% translated)
- intro.po 0 / 92 ( 0.0% translated)
- iter.po 5 / 5 (100.0% translated)
- iterator.po 8 / 8 (100.0% translated)
- list.po 0 / 23 ( 0.0% translated)
- long.po 0 / 52 ( 0.0% translated)
- mapping.po 15 / 15 (100.0% translated)
- marshal.po 15 / 15 (100.0% translated)
- memory.po 0 / 150 ( 0.0% translated)
- memoryview.po 8 / 9 ( 88.0% translated), 1 fuzzy
- method.po 17 / 17 (100.0% translated)
- module.po 0 / 87 ( 0.0% translated)
- none.po 4 / 4 (100.0% translated)
- number.po 0 / 41 ( 0.0% translated)
- objbuffer.po 8 / 8 (100.0% translated)
- object.po 0 / 77 ( 0.0% translated)
- objimpl.po 2 / 2 (100.0% translated)
- refcounting.po 11 / 11 (100.0% translated)
- reflection.po 8 / 8 (100.0% translated)
- sequence.po 0 / 27 ( 0.0% translated)
- set.po 0 / 23 ( 0.0% translated)
- slice.po 0 / 20 ( 0.0% translated)
- stable.po 6 / 6 (100.0% translated)
- structures.po 0 / 112 ( 0.0% translated)
- sys.po 0 / 69 ( 0.0% translated)
- tuple.po 0 / 48 ( 0.0% translated)
- type.po 0 / 52 ( 0.0% translated)
- typeobj.po 0 / 586 ( 0.0% translated)
- unicode.po 0 / 332 ( 0.0% translated)
- utilities.po 2 / 2 (100.0% translated)
- veryhigh.po 61 / 61 (100.0% translated)
- weakref.po 10 / 10 (100.0% translated)
(Yes it's a patched version of potodo that displays 100.0% translated lines also, to better see the issue)
It indicates ~47% is done, but visually I don't think so, so I checked and find 9%:
$ potodo --offline --path c-api/ | awk '{done += $3; all += $5} END {print 100 * done / all}'
9.4029
9% makes more sense when we count translated and untranslated entries:
$ msgcat c-api/*.po | msgattrib --translated | grep -c '^msgid'
343
(python-docs-es) mdk@seraph:~/clones/python/python-docs-es (3.8)
$ msgcat c-api/*.po | grep -c '^msgid'
3508
there's 343/3508 entries translated, roughly 10%, so the 9.4% looks right, the 47% looks wrong.
Oh, is it 47% of files done? Maybe not:
$ potodo --offline --path c-api/ | grep -c ^-
61
$ potodo --offline --path c-api/ | grep -c 100.0%
27
$ python3
>>> 100 * 27 / 61
44.26229508196721
setup.py
has classissifier python3.5
but this can't be true since the code includes f-strings. So that classifier should be removed. Does potodo run on Python 3.6 ?
With black and mypy and pytests with coverage
On #23 it was commented out as it was producing a weird bug
Edited
_Originally posted by @JulienPalard in https://github.com/Seluj78/Potodo/pull/48/files#r366526201
Non tu ne semble pas avoir raté grand chose. C'est juste dommage de les transformer en str
après, probablement un souci de compat python 3.5 ou 3.6 j'imagine. => we're dropping support for 3.5
Il faudrait tenter de faire l'effort contraire dans une autre PR peut être : la garder en Path le plus loin possible. Typique cette str est re-transformé en Path dans pofile.py a la ligne 60.
potodo should look for "upstream" AND "origin". It only checks for "origin".
Worse, looking for a non-existent remote make it fails with a CalledProcessError
If you run potodo in the potodo folder, you get a divide by 0 error
(python-docs-i18n) ➜ ~ potodo -p Projects/python-docs-fr
Traceback (most recent call last):
File "/Users/seluj78/.venvs/python-docs-i18n/bin/potodo", line 8, in <module>
sys.exit(main())
File "/Users/seluj78/.venvs/python-docs-i18n/lib/python3.7/site-packages/potodo/potodo.py", line 232, in main
args.no_reserved,
File "/Users/seluj78/.venvs/python-docs-i18n/lib/python3.7/site-packages/potodo/potodo.py", line 78, in exec_potodo
issue_reservations = get_gh_issue_reservation()
File "/Users/seluj78/.venvs/python-docs-i18n/lib/python3.7/site-packages/potodo/potodo.py", line 21, in get_gh_issue_reservation
issues = requests.get("https://api.github.com/repos/" + get_repo_name() + "/issues").json()
File "/Users/seluj78/.venvs/python-docs-i18n/lib/python3.7/site-packages/potodo/_github.py", line 14, in get_repo_name
repo_url: str = get_repo_url()
File "/Users/seluj78/.venvs/python-docs-i18n/lib/python3.7/site-packages/potodo/_github.py", line 9, in get_repo_url
raise ValueError(f"Unknown error. `git get-url --all upstream|origin` returned {url}")
ValueError: Unknown error. `git get-url --all upstream|origin` returned fatal: not a git repository (or any of the parent directories): .git
(python-docs-i18n) ➜ ~
Idea for a strategy to find the repo from the remote list:
Demo of finding it indirectly:
$ curl https://api.github.com/repos/seluj78/python-docs-fr | jq .parent.url
"https://api.github.com/repos/python/python-docs-fr"
Or demo of lucky "it was the right one so it has no parent":
$ curl https://api.github.com/repos/python/python-docs-fr | jq .parent.url
null
Originally posted by @JulienPalard in #37 (comment)
this is the body
Dependabot couldn't authenticate with https://pypi.python.org/simple/.
You can provide authentication details in your Dependabot dashboard by clicking into the account menu (in the top right) and selecting 'Config variables'.
With exclusion parameter for c-api
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.