diff --git a/gajim/gtk/profile.py b/gajim/gtk/profile.py index ca8b34f8c..6f7137a83 100644 --- a/gajim/gtk/profile.py +++ b/gajim/gtk/profile.py @@ -230,7 +230,7 @@ class ProfileWindow(Gtk.ApplicationWindow): button.show() text_button.hide() continue - if i == 'ADR' or i == 'TEL' or i == 'EMAIL': + if i in ('ADR', 'TEL', 'EMAIL'): for entry in vcard_[i]: add_on = '_HOME' if 'WORK' in entry: diff --git a/gajim/htmltextview.py b/gajim/htmltextview.py index ef01fc567..d87afaf98 100644 --- a/gajim/htmltextview.py +++ b/gajim/htmltextview.py @@ -804,7 +804,7 @@ class HtmlHandler(xml.sax.handler.ContentHandler): newLine = True elif name == 'img': pass - elif name == 'body' or name == 'html': + elif name in ('body', 'html'): pass elif name == 'a': pass diff --git a/gajim/message_textview.py b/gajim/message_textview.py index 3b71f881a..b0790a25c 100644 --- a/gajim/message_textview.py +++ b/gajim/message_textview.py @@ -98,7 +98,7 @@ class MessageTextView(Gtk.TextView): buf = self.get_buffer() start, end = buf.get_bounds() text = buf.get_text(start, end, True) - return text != self.PLACEHOLDER and text != '' + return text not in (self.PLACEHOLDER, '') def get_text(self): # gets the text if its not PLACEHOLDER @@ -211,7 +211,7 @@ class MessageTextView(Gtk.TextView): _buffer.remove_all_tags(start, finish) def color_set(self, widget, response): - if response == -6 or response == -4: + if response in (-6, -4): widget.destroy() return @@ -238,7 +238,7 @@ class MessageTextView(Gtk.TextView): _buffer.apply_tag_by_name(tag_name, start, finish) def font_set(self, widget, response, start, finish): - if response == -6 or response == -4: + if response in (-6, -4): widget.destroy() return diff --git a/gajim/message_window.py b/gajim/message_window.py index 69ef16aa6..54479ca24 100644 --- a/gajim/message_window.py +++ b/gajim/message_window.py @@ -374,7 +374,7 @@ class MessageWindow: self.window.lookup_action( 'information-%s' % control.control_id).activate() return True - elif keyval == Gdk.KEY_l or keyval == Gdk.KEY_L: # CTRL + l|L + elif keyval in (Gdk.KEY_l, Gdk.KEY_L): # CTRL + l|L control.conv_textview.clear() return True elif keyval == Gdk.KEY_u: # CTRL + u: emacs style clear line