Skip to content

Commit c7d00e6

Browse files
committed
Agrega pequeñas mejores a check_spell.po
* Imprime mapeo de archivos sólo si hay errores * Path.glob() produce un map en vez de una lista. Este map se consume en el primer loop (al crear los archivos temporales), después del cual no se pueden consumir más elementos. Esto quiere decir que, en caso de haber fallos de ortografía, el último for que imprime el mapeo entre archivos no imprimía nada, dado que el objecto map ya no entregaba resultados. Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
1 parent 5f2689e commit c7d00e6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/check_spell.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def check_spell(po_files=None):
4343

4444
# Run pospell either against all files or the file given on the command line
4545
if not po_files:
46-
po_files = Path(".").glob("*/*.po")
46+
po_files = list(Path(".").glob("*/*.po"))
4747

4848
# Workaround issue #3324 FIXME
4949
# It seems that all code snippets have line breaks '\n'. This causes the
@@ -66,8 +66,9 @@ def check_spell(po_files=None):
6666
polib_temp_file.save()
6767

6868
detected_errors = pospell.spell_check(po_files_tmp, personal_dict=output_filename, language="es_ES")
69-
for tmp, orig in zip(po_files_tmp, po_files):
70-
print(tmp, " == ", orig)
69+
if detected_errors:
70+
for tmp, orig in zip(po_files_tmp, po_files):
71+
print(tmp, " == ", orig)
7172
return detected_errors
7273

7374

0 commit comments

Comments
 (0)