normalizar-case
This commit is contained in:
@@ -70,6 +70,20 @@ def _print_preview(step: str, preview: dict, formato: str) -> None:
|
||||
print(f" ... y {n - 10} más")
|
||||
print(f"Formato final del archivo: {fmt}")
|
||||
|
||||
elif step == "normalize_case":
|
||||
renames = preview["renames"]
|
||||
mode_label = "minúsculas" if preview["mode"] == "lower" else "mayúsculas"
|
||||
n = len(renames)
|
||||
print(f"Normalización de extensiones a {mode_label} ({n} ficheros):")
|
||||
print(f" {'Nombre actual':<{_COL_W}} → Nombre final")
|
||||
print(f" {_SEP}")
|
||||
display = renames[:10] if n > 20 else renames
|
||||
for orig, final in display:
|
||||
print(f" {orig:<{_COL_W}} {final}")
|
||||
if n > 20:
|
||||
print(f" ... y {n - 10} más")
|
||||
print(f"Formato final del archivo: {formato.upper()}")
|
||||
|
||||
elif step in ("normalize_images", "convert_images"):
|
||||
conversions = preview["conversions"]
|
||||
target_ext = preview["target_ext"].lstrip(".")
|
||||
@@ -117,6 +131,13 @@ def parse_args():
|
||||
parser.add_argument("--uniformizar-imagenes", action="store_true")
|
||||
parser.add_argument("--convertir-imagenes", action="store_true")
|
||||
parser.add_argument("--formato-imagen", choices=["jpg", "png", "webp"], default="png")
|
||||
parser.add_argument("--normalizar-case", action="store_true", dest="normalizar_case")
|
||||
parser.add_argument(
|
||||
"--modo-case",
|
||||
choices=["lower", "upper"],
|
||||
default="lower",
|
||||
dest="modo_case",
|
||||
)
|
||||
|
||||
parser.add_argument("--no-preguntar", action="store_true")
|
||||
parser.add_argument(
|
||||
@@ -171,6 +192,8 @@ def main():
|
||||
steps.append("normalize_images")
|
||||
if args.convertir_imagenes:
|
||||
steps.append("convert_images")
|
||||
if args.normalizar_case or args.estandarizar:
|
||||
steps.append("normalize_case")
|
||||
if args.convertir or args.estandarizar:
|
||||
steps.append("convert")
|
||||
|
||||
@@ -182,6 +205,7 @@ def main():
|
||||
desired_format=args.formato,
|
||||
desired_image_format="." + args.formato_imagen,
|
||||
collision_policy=collision,
|
||||
case_mode=args.modo_case,
|
||||
)
|
||||
collector = SummaryCollector()
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user