From e4b315f252f4b9e284e5e4ee215be8d31b0edb04 Mon Sep 17 00:00:00 2001 From: GeoffreyCoulaud Date: Thu, 29 Jun 2023 17:29:16 +0200 Subject: [PATCH] Added log files contents to aboutwindow debug info --- src/main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 288f7e1..12e0f80 100644 --- a/src/main.py +++ b/src/main.py @@ -143,10 +143,16 @@ class CartridgesApplication(Adw.Application): shared.store.add_game(game, {"skip_save": True}) def on_about_action(self, *_args): + # Get the debug info from the log files debug_str = "" for path in shared.log_files: - log_file = lzma.open(path, "rt", encoding="utf-8") + log_file = ( + lzma.open(path, "rt", encoding="utf-8") + if path.name.endswith(".xz") + else open(path, "r", encoding="utf-8") + ) debug_str += log_file.read() + log_file.close() about = Adw.AboutWindow( transient_for=self.win,