diff --git a/fftcg/cards.py b/fftcg/cards.py index bf55c2f..793f8e4 100644 --- a/fftcg/cards.py +++ b/fftcg/cards.py @@ -12,7 +12,7 @@ class Cards(list[Card]): self.__name = name def __repr__(self) -> str: - return f"[{', '.join(str(card) for card in self)}]" + return f"{self.name!r} ({len(self)} Cards)" def __str__(self) -> str: return repr(self) diff --git a/fftcgtool.py b/fftcgtool.py index 4404f20..24e6692 100755 --- a/fftcgtool.py +++ b/fftcgtool.py @@ -178,18 +178,25 @@ def ffdecks(deck_ids) -> list[fftcg.TTSDeck]: @main.result_callback() def finalize(decks: list[fftcg.TTSDeck], **kwargs): + logger = logging.getLogger(__name__) + # decide what to do with the decks if kwargs["zip"] is not None: + logger.debug("Outputting decks to ZIP") if decks: # create zip file with zipfile.ZipFile(kwargs["zip"], "w", compression=zipfile.ZIP_DEFLATED) as zip_file: # put the decks into that zip file for deck in decks: + logger.debug(f"Saving Deck {deck!r}") zip_file.writestr(deck.file_name, deck.get_json(kwargs["language"])) else: + logger.debug("Outputting decks to disk") + # save the decks to disk for deck in decks: + logger.debug(f"Saving Deck {deck!r}") deck.save(kwargs["language"]) # bye