Repository navigation
Card list: imágenes locales para importar el lote de Card Conjurer - #5
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.jsonque los nombra por ruta relativa).cardlist.parse_list(text, base_dir=None): conbase_dir,imageybackpueden ser rutas relativas a la carpeta de la lista (por ejemplocards/001-badlands.png). Solo cuentan archivos de imagen existentes dentro de esa carpeta; se rechazan rutas absolutas y las que salen con../. Unfile://escrito en la lista se sigue rechazando.file://yscryfall.download_to_templas copia en vez de descargarlas.gui._load_card_listpasa la carpeta de la lista.Sin
base_dir(texto pegado) todo funciona igual que antes.Pruebas
tests/test_card_list.py(rutas aceptadas, dorso local, sin carpeta, salida con../, archivo inexistente, no imagen, ruta absoluta, copia endownload_to_temp). La suite completa pasa: 275 pasan, 1 omitida.🤖 Generated with Claude Code