diff options
author | Bastien Nocera <hadess@hadess.net> | 2022-06-23 16:13:48 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2022-06-27 14:36:12 +0200 |
commit | ab33d9ae4d1de2f07cd1b5a62cf4a3e6fb8f9ee7 (patch) | |
tree | 26c0a9982869bd720591b3f7c962a1492276a37f /src | |
parent | 267f18b5b70575fe5e6a86ac1e0c45e9129463de (diff) | |
download | totem-ab33d9ae4d1de2f07cd1b5a62cf4a3e6fb8f9ee7.tar.gz |
pythonconsole: Fix some pylint warnings
src/plugins/pythonconsole/console.py:173:13: R1714: Consider merging these comparisons with "in" to 'event.keyval in (Gdk.KEY_KP_Down, Gdk.KEY_Down)' (consider-using-in)
src/plugins/pythonconsole/console.py:180:13: R1714: Consider merging these comparisons with "in" to 'event.keyval in (Gdk.KEY_KP_Up, Gdk.KEY_Up)' (consider-using-in)
src/plugins/pythonconsole/console.py:187:13: R1714: Consider merging these comparisons with "in" to 'event.keyval in (Gdk.KEY_KP_Left, Gdk.KEY_Left, Gdk.KEY_BackSpace)' (consider-using-in)
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/pythonconsole/console.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/plugins/pythonconsole/console.py b/src/plugins/pythonconsole/console.py index aa8f5a754..7a8114114 100644 --- a/src/plugins/pythonconsole/console.py +++ b/src/plugins/pythonconsole/console.py @@ -170,23 +170,21 @@ class PythonConsole(Gtk.ScrolledWindow): # pylint: disable=R0902 GLib.idle_add(self.scroll_to_end) return True - elif event.keyval == Gdk.KEY_KP_Down or event.keyval == Gdk.KEY_Down: + elif event.keyval in (Gdk.KEY_KP_Down, Gdk.KEY_Down): # Next entry from history view.emit_stop_by_name("key_press_event") self.history_down() GLib.idle_add(self.scroll_to_end) return True - elif event.keyval == Gdk.KEY_KP_Up or event.keyval == Gdk.KEY_Up: + elif event.keyval in (Gdk.KEY_KP_Up, Gdk.KEY_Up): # Previous entry from history view.emit_stop_by_name("key_press_event") self.history_up() GLib.idle_add(self.scroll_to_end) return True - elif event.keyval == Gdk.KEY_KP_Left or \ - event.keyval == Gdk.KEY_Left or \ - event.keyval == Gdk.KEY_BackSpace: + elif event.keyval in (Gdk.KEY_KP_Left, Gdk.KEY_Left, Gdk.KEY_BackSpace): buf = view.get_buffer() inp = buf.get_iter_at_mark(buf.get_mark("input")) cur = buf.get_iter_at_mark(buf.get_insert()) |