From ab7a92dd37ffe25476ae164b9a7dde992e2063fb Mon Sep 17 00:00:00 2001 From: LDericher <40151420+ldericher@users.noreply.github.com> Date: Mon, 6 Sep 2021 05:07:11 +0200 Subject: [PATCH] debug output --- fftcg/cards.py | 2 +- fftcgtool.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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