From 5ae59148f611ce02d71a8123de5b87119d062541 Mon Sep 17 00:00:00 2001 From: xxyzz Date: Mon, 22 Apr 2024 18:20:06 +0800 Subject: [PATCH] Fix unpack exception #209 mypy can't even find this bug? --- pyproject.toml | 2 +- ui.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ba273a2..ee2641f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ select = [ exclude = ["tests", "__main__", "docs"] explicit_package_bases = true check_untyped_defs = true -# strict = True +# strict = true [[tool.mypy.overrides]] module = "calibre.*" diff --git a/ui.py b/ui.py index 3906712..3d98132 100644 --- a/ui.py +++ b/ui.py @@ -73,9 +73,11 @@ def genesis(self): def config(self): self.interface_action_base_plugin.do_user_config(self.gui) - def open_custom_x_ray_dialog(self): - for _, _, book_paths, mi, _ in get_metadata_of_selected_books(self.gui, True): - custom_x_dlg = CustomXRayDialog(book_paths[0], mi.get("title"), self.gui) + def open_custom_x_ray_dialog(self) -> None: + for md_result in get_metadata_of_selected_books(self.gui, True): + custom_x_dlg = CustomXRayDialog( + md_result.book_paths[0], md_result.mi.get("title"), self.gui + ) if custom_x_dlg.exec(): custom_x_dlg.x_ray_model.save_data()