Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix create issue script#2876

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
cacrespo merged 9 commits intopython:3.12fromsofide:fix_create_issue_script
Nov 21, 2024
Merged

Conversation

sofide
Copy link
Collaborator

Algunas mejoras para el script que genera issues.

Lo probé en mi fork y me generó por ejemplo este issue:sofide#2



def check_issue_not_already_existing(pofilename):
issues = repo.get_issues(state='open')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Supongo que no es un problema, pero sería bueno revisar cómo cachar esta request, veo que nos traemos todos los issues y supongo esto ocurre para cada pofile.

Copy link
Collaborator

@rtobarrtobarNov 21, 2024
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Totalmente de acuerdo con el comentario, no creo que sea mucho cambiar el código para hacer una sola query?

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Done por acá:6916e38

Copy link
Collaborator

@rtobarrtobar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Súper contribución@sofide! Dejo algunos comentarios, pero nada urgente, tómalos o déjalos

repo = g.get_repo('python/python-docs-es')

PYTHON_VERSION = "3.13"
ISSUE_LABELS = [PYTHON_VERSION, "good first issue"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

El "good first issue" yo lo aplicaría sólo para issues donde jay que traducir menos de N entradas (5, 10?) en vez de aplicarlo de forma indiscriminada a todos

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Me gustó la idea, done acá:1915095

answer = input(msg)
if answer != 'y':
sys.exit(1)
- Fuzzy: {pofile_fuzzy}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

La forma en que estas estadísticas se muestran siempre me ha parecido un poco confusa, porque hay que hacer un poco de matemáticas para entender cuántas entradas de verdad necesitan trabajo. Parte de esa confusión (creo) también es que las entradas fuzzy creo que cuentan para el pofile.percent_translated, pero puedo estar equivocando (o quizás ha cambiado eso en potodo).

Yo mostraría la información más o menso así (usando formato de f-string para ejemplificar nada más)

- Total entries: {T}- Entries that need work: {F + U} ({(F + U)/T * 100:.2f} %)  - Fuzzy: {F}  - Untranslated: {U}

Dime qué te parece la idea.

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

De acuerdo en que son confusas.
Mejorado acá1915095 y luego arreglado acá9938321

if len(sys.argv) != 2:
raise Exception(error_msg)

arg = sys.argv[1]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Una idea que tenía era agregar un modo "dry run", pero queda para el futuro, necesitaría más cambios de los que hay hasta el momento

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

de acuerdo con la idea, y con que se haga a futuro 😅

if pofilename in issue.title:

print(f'Skipping {pofilename}. There is a similar issue already created at {issue.html_url}')
raise IssueAlreadyExistingError()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Nitpick: no hace falta instanciar acá

Suggested change
raiseIssueAlreadyExistingError()
raiseIssueAlreadyExistingError

sofide reacted with thumbs up emoji
pofile.untranslated == 0,
]):
print(f'Skipping {pofile.filename}. The file is 100% translated already.')
raise PoFileAlreadyTranslated()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Ni acá

sofide reacted with thumbs up emoji


def check_translation_is_pending(pofile):
if pofile.fuzzy == 0 and any([
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Veo que esteany estaba en el original, pero lo encuentro innecesariamente confuso. En vez de hacerany([a, b]) puedes hacer(a or b).

Pero creo que la lógica podría ser simplificada de todas formas. Se me hace queif not pofile.fuzzy and not pofile.untranslated sería suficiente, pero habría que probar

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

De acuerdo, mejoré un poco esto acá:9461867

@sofide
Copy link
CollaboratorAuthor

Con los últimos cambios volví a correrlo en mi fork personal y se creó este issue, para que vean de ejemplo:sofide#7

@cacrespocacrespo merged commit30a3564 intopython:3.12Nov 21, 2024
4 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@rtobarrtobarrtobar left review comments

@cacrespocacrespocacrespo approved these changes

@erickisoserickisoserickisos approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@sofide@rtobar@cacrespo@erickisos

[8]ページ先頭

©2009-2025 Movatter.jp