From 29647ea6931408763cabb39af2bf90cbaef218ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Tue, 18 Sep 2018 13:38:22 +0200 Subject: [PATCH] Fix trailing-whitespace pylint errors --- gajim/chat_control.py | 7 ++++--- gajim/chat_control_base.py | 2 +- gajim/common/connection.py | 2 +- gajim/common/connection_handlers_events.py | 6 +++--- gajim/conversation_textview.py | 2 +- gajim/dataforms_widget.py | 2 +- gajim/plugins/pluginmanager.py | 14 +++++++------- gajim/roster_window.py | 4 ++-- 8 files changed, 20 insertions(+), 19 deletions(-) diff --git a/gajim/chat_control.py b/gajim/chat_control.py index da3cae342..ac8da8eb2 100644 --- a/gajim/chat_control.py +++ b/gajim/chat_control.py @@ -812,8 +812,9 @@ class ChatControl(ChatControlBase): if obj.kind == KindConstant.CHAT_MSG_SENT: kind = 'outgoing' - self.print_conversation(obj.msgtxt, kind, tim=obj.timestamp, - encrypted=obj.encrypted, correct_id=obj.correct_id, + self.print_conversation( + obj.msgtxt, kind, tim=obj.timestamp, + encrypted=obj.encrypted, correct_id=obj.correct_id, msg_stanza_id=obj.message_id, additional_data=obj.additional_data) def _nec_decrypted_message_received(self, obj): @@ -1039,7 +1040,7 @@ class ChatControl(ChatControlBase): def prepare_context_menu(self, hide_buttonbar_items=False): """ Set compact view menuitem active state sets active and sensitivity state - for history_menuitem (False for tranasports) and file_transfer_menuitem + for history_menuitem (False for tranasports) and file_transfer_menuitem and hide()/show() for add_to_roster_menuitem """ if app.jid_is_transport(self.contact.jid): diff --git a/gajim/chat_control_base.py b/gajim/chat_control_base.py index b6aa82de5..683f865c6 100644 --- a/gajim/chat_control_base.py +++ b/gajim/chat_control_base.py @@ -576,7 +576,7 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools): if (event.get_state() & Gdk.ModifierType.CONTROL_MASK and keycode in ( self.keycode_c, self.keycode_ins)): return False - + if event.get_state() & Gdk.ModifierType.SHIFT_MASK and \ event.keyval in (Gdk.KEY_Page_Down, Gdk.KEY_Page_Up): self._on_scroll(None, event.keyval) diff --git a/gajim/common/connection.py b/gajim/common/connection.py index 00dcfea4f..0f0cfd922 100644 --- a/gajim/common/connection.py +++ b/gajim/common/connection.py @@ -603,7 +603,7 @@ class Connection(CommonConnection, ConnectionHandlers): if warn: log.warning('only bare JID available') - # This returns the bare jid + # This returns the bare jid return nbxmpp.JID(app.get_jid_from_account(self.name)) def reconnect(self): diff --git a/gajim/common/connection_handlers_events.py b/gajim/common/connection_handlers_events.py index 981fad95b..4d8a2534d 100644 --- a/gajim/common/connection_handlers_events.py +++ b/gajim/common/connection_handlers_events.py @@ -669,16 +669,16 @@ class ConnectionTypeEvent(nec.NetworkIncomingEvent): class StanzaReceivedEvent(nec.NetworkIncomingEvent): name = 'stanza-received' - + def init(self): self.additional_data = {} - + def generate(self): return True class StanzaSentEvent(nec.NetworkIncomingEvent): name = 'stanza-sent' - + def init(self): self.additional_data = {} diff --git a/gajim/conversation_textview.py b/gajim/conversation_textview.py index c8bf4b9d2..8923defca 100644 --- a/gajim/conversation_textview.py +++ b/gajim/conversation_textview.py @@ -1187,7 +1187,7 @@ class ConversationTextview(GObject.GObject): text_tags.append('outgoingtxt') self.print_subject(subject, iter_=iter_) - + iter_ = self.print_real_text(text, text_tags, name, xhtml, graphics=graphics, mark=insert_mark, additional_data=additional_data) diff --git a/gajim/dataforms_widget.py b/gajim/dataforms_widget.py index fe4338cdb..27710ffce 100644 --- a/gajim/dataforms_widget.py +++ b/gajim/dataforms_widget.py @@ -637,7 +637,7 @@ class SingleForm(Gtk.Table): try: newtext = helpers.parse_jid(newtext) except helpers.InvalidFormat as s: - app.interface.raise_dialog('invalid-jid-with-error', str(s)) + app.interface.raise_dialog('invalid-jid-with-error', str(s)) return if newtext in field.values: app.interface.raise_dialog('jid-in-list') diff --git a/gajim/plugins/pluginmanager.py b/gajim/plugins/pluginmanager.py index 6f7fc4b65..72941ca50 100644 --- a/gajim/plugins/pluginmanager.py +++ b/gajim/plugins/pluginmanager.py @@ -151,17 +151,17 @@ class PluginManager(metaclass=Singleton): @log_calls('PluginManager') def remove_plugin(self, plugin): ''' - removes the plugin from the plugin list and deletes all loaded modules + removes the plugin from the plugin list and deletes all loaded modules from sys. This way we will have a fresh start when the plugin gets added again. ''' if plugin.active: self.deactivate_plugin(plugin) - + self.plugins.remove(plugin) - + # remove modules from cache - base_package = plugin.__module__.split('.')[0] + base_package = plugin.__module__.split('.')[0] # get the subpackages/-modules of the base_package. Add a dot to the # name to avoid name problems (removing module_abc if base_package is # module_ab) @@ -170,10 +170,10 @@ class PluginManager(metaclass=Singleton): # remove the base_package itself if base_package in sys.modules: modules_to_remove.append(base_package) - + for module_to_remove in modules_to_remove: - del sys.modules[module_to_remove] - + del sys.modules[module_to_remove] + @log_calls('PluginManager') def add_plugins(self, plugin_classes): for plugin_class in plugin_classes: diff --git a/gajim/roster_window.py b/gajim/roster_window.py index 496f35174..8ca79f26c 100644 --- a/gajim/roster_window.py +++ b/gajim/roster_window.py @@ -4021,7 +4021,7 @@ class RosterWindow: # account = row[Column.ACCOUNT] # self._last_selected_contact.append((jid, account)) # GLib.idle_add(self.draw_contact, jid, account, True) - + def on_service_disco_menuitem_activate(self, widget, account): server_jid = app.config.get_per('accounts', account, 'hostname') @@ -5583,7 +5583,7 @@ class RosterWindow: if typ in ('contact', 'self_contact'): contacts = app.contacts.get_contacts(account, jid) - + for c in contacts: if c.show not in ('offline', 'error'): connected_contacts.append(c)