From eed07e4bb0c6aeeae01905b02bee6f2023b93ec6 Mon Sep 17 00:00:00 2001 From: LDericher <40151420+ldericher@users.noreply.github.com> Date: Mon, 16 Aug 2021 04:01:39 +0200 Subject: [PATCH] yaml Loader/Dumper --- fftcg/book.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fftcg/book.py b/fftcg/book.py index bc24444..0578a41 100644 --- a/fftcg/book.py +++ b/fftcg/book.py @@ -60,7 +60,7 @@ class Book: # load pages.yml file try: with open("pages.yml", "r") as file: - pages = yaml.load(file) + pages = yaml.load(file, Loader=yaml.Loader) except FileNotFoundError: pages = {} @@ -71,8 +71,8 @@ class Book: page["image"].save(fn) # add contents of image pages[fn] = {} - pages[fn]["cards"] = page["cards"] # [card.code for card in page["cards"]] + pages[fn]["cards"] = page["cards"] # update pages.yml file with open("pages.yml", "w") as file: - yaml.dump(pages, file) + yaml.dump(pages, file, Dumper=yaml.Dumper)