fix desquadre del resum
This commit is contained in:
+16
-12
@@ -60,30 +60,34 @@ class SummaryCollector:
|
||||
format_converted = count_step(["convert"])
|
||||
case_normalized = count_step(["normalize_case", "normalize_case_outer"])
|
||||
|
||||
w = max(len(str(total)), 3)
|
||||
# _TL y _SL son los anchos de label que alinean los ':' en la misma columna:
|
||||
# " " + 24 + " :" = posición 27 / " · " + 20 + " :" = posición 27
|
||||
_TL, _SL = 24, 20
|
||||
lines = [
|
||||
_BORDER,
|
||||
" RESUMEN DEL PROCESAMIENTO",
|
||||
_BORDER,
|
||||
f" Total procesados : {total:>3}",
|
||||
f" Sin cambios : {len(no_changes):>3}",
|
||||
f" Modificados : {len(modified):>3}",
|
||||
f" {'Total procesados':<{_TL}} : {total:>{w}}",
|
||||
f" {'Sin cambios':<{_TL}} : {len(no_changes):>{w}}",
|
||||
f" {'Modificados':<{_TL}} : {len(modified):>{w}}",
|
||||
]
|
||||
if modified:
|
||||
if cleaned:
|
||||
lines.append(f" · Limpiados : {cleaned:>3}")
|
||||
lines.append(f" · {'Limpiados':<{_SL}} : {cleaned:>{w}}")
|
||||
if pages_normalized:
|
||||
lines.append(f" · Páginas normalizadas : {pages_normalized:>3}")
|
||||
lines.append(f" · {'Páginas normalizadas':<{_SL}} : {pages_normalized:>{w}}")
|
||||
if images_converted:
|
||||
lines.append(f" · Imágenes convertidas : {images_converted:>3}")
|
||||
lines.append(f" · {'Imágenes convertidas':<{_SL}} : {images_converted:>{w}}")
|
||||
if format_converted:
|
||||
lines.append(f" · Formato convertido : {format_converted:>3}")
|
||||
lines.append(f" · {'Formato convertido':<{_SL}} : {format_converted:>{w}}")
|
||||
if case_normalized:
|
||||
lines.append(f" · Case normalizado : {case_normalized:>3}")
|
||||
lines.append(f" Advertencias : {len(warnings_only):>3}")
|
||||
lines.append(f" Errores : {len(errors):>3}")
|
||||
lines.append(f" · {'Case normalizado':<{_SL}} : {case_normalized:>{w}}")
|
||||
lines.append(f" {'Advertencias':<{_TL}} : {len(warnings_only):>{w}}")
|
||||
lines.append(f" {'Errores':<{_TL}} : {len(errors):>{w}}")
|
||||
if errors:
|
||||
lines.append(f" · Corruptos : {len(corrupt):>3}")
|
||||
lines.append(f" · Otros errores : {len(other_errors):>3}")
|
||||
lines.append(f" · {'Corruptos':<{_SL}} : {len(corrupt):>{w}}")
|
||||
lines.append(f" · {'Otros errores':<{_SL}} : {len(other_errors):>{w}}")
|
||||
lines.append(_BORDER)
|
||||
|
||||
if corrupt:
|
||||
|
||||
Reference in New Issue
Block a user