From e4b3f59ebb8cb4433e09f82ea37d555c29ecb947 Mon Sep 17 00:00:00 2001 From: Domefemia Date: Sun, 16 Apr 2023 19:51:17 +0200 Subject: [PATCH] Replaced multiple comparison with in function --- piper/buttondialog.py | 2 +- piper/window.py | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/piper/buttondialog.py b/piper/buttondialog.py index 949dd9a..facd628 100644 --- a/piper/buttondialog.py +++ b/piper/buttondialog.py @@ -165,7 +165,7 @@ class ButtonDialog(Gtk.Dialog): self.listbox.select_row(row) i += 1 for key, name in RatbagdButton.SPECIAL_DESCRIPTION.items(): - if name == "Unknown" or name == "Invalid": + if name in ["Unknown", "Invalid"]: continue # Translators: section header for assigning special functions to buttons. row = ButtonRow( diff --git a/piper/window.py b/piper/window.py index 6a008f6..e665810 100644 --- a/piper/window.py +++ b/piper/window.py @@ -97,10 +97,7 @@ class Window(Gtk.ApplicationWindow): response = dialog.run() dialog.destroy() - if ( - response == Gtk.ResponseType.NO - or response == Gtk.ResponseType.DELETE_EVENT - ): + if response in [Gtk.ResponseType.NO, Gtk.ResponseType.DELETE_EVENT]: return Gdk.EVENT_STOP return Gdk.EVENT_PROPAGATE