Skip to content

Card list: imágenes locales para importar el lote de Card Conjurer - #5

Merged
Boffo90 merged 1 commit into
mainfrom
card-list-local-images
Oct 3, 2026
Merged

Boffo90 merged 1 commit into
mainfrom
card-list-local-images

Conversation

@Boffo90

@Boffo90 Boffo90 commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Resumen

"Card list…" acepta ahora imágenes que están junto a la lista, para importar el lote que exporta Card Conjurer (un ZIP con los PNG y un cardwright-list.json que los nombra por ruta relativa).

  • cardlist.parse_list(text, base_dir=None): con base_dir, image y back pueden ser rutas relativas a la carpeta de la lista (por ejemplo cards/001-badlands.png). Solo cuentan archivos de imagen existentes dentro de esa carpeta; se rechazan rutas absolutas y las que salen con ../. Un file:// escrito en la lista se sigue rechazando.
  • Las rutas aceptadas pasan como file:// y scryfall.download_to_temp las copia en vez de descargarlas.
  • gui._load_card_list pasa la carpeta de la lista.

Sin base_dir (texto pegado) todo funciona igual que antes.

Pruebas

  • 7 pruebas nuevas en tests/test_card_list.py (rutas aceptadas, dorso local, sin carpeta, salida con ../, archivo inexistente, no imagen, ruta absoluta, copia en download_to_temp). La suite completa pasa: 275 pasan, 1 omitida.
  • Importada la lista de un lote real de Card Conjurer: las imágenes locales se copian y las URL remotas se mantienen.

🤖 Generated with Claude Code

…mports

A card list could only name images by http(s) url, so a batch rendered
elsewhere (Card Conjurer's batch export: a zip of PNGs plus the list) had no
way in without uploading every image first.

Now an image (or back) can be a path relative to the list's folder, such as
"cards/001-badlands.png". Only existing image files inside that folder count:
absolute paths and "../" are refused, and a file:// url written in the list is
still refused as before. Accepted paths become file:// urls that
download_to_temp copies instead of fetching.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Boffo90
Boffo90 merged commit 619059d into main Oct 3, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant