Replaced multiple comparison with in function

This commit is contained in:
Domefemia
2023-04-16 19:51:17 +02:00
committed by Yaroslav Chvanov
parent da0056500d
commit e4b3f59ebb
2 changed files with 2 additions and 5 deletions

View File

@@ -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(

View File

@@ -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