Fix trailing-whitespace pylint errors

This commit is contained in:
Philipp Hörist 2018-09-18 13:38:22 +02:00 committed by Philipp Hörist
parent e842298724
commit f12dfb811d
8 changed files with 20 additions and 19 deletions

View File

@ -812,8 +812,9 @@ class ChatControl(ChatControlBase):
if obj.kind == KindConstant.CHAT_MSG_SENT: if obj.kind == KindConstant.CHAT_MSG_SENT:
kind = 'outgoing' kind = 'outgoing'
self.print_conversation(obj.msgtxt, kind, tim=obj.timestamp, self.print_conversation(
encrypted=obj.encrypted, correct_id=obj.correct_id, 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) msg_stanza_id=obj.message_id, additional_data=obj.additional_data)
def _nec_decrypted_message_received(self, obj): def _nec_decrypted_message_received(self, obj):
@ -1039,7 +1040,7 @@ class ChatControl(ChatControlBase):
def prepare_context_menu(self, hide_buttonbar_items=False): def prepare_context_menu(self, hide_buttonbar_items=False):
""" """
Set compact view menuitem active state sets active and sensitivity state 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 and hide()/show() for add_to_roster_menuitem
""" """
if app.jid_is_transport(self.contact.jid): if app.jid_is_transport(self.contact.jid):

View File

@ -576,7 +576,7 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
if (event.get_state() & Gdk.ModifierType.CONTROL_MASK and keycode in ( if (event.get_state() & Gdk.ModifierType.CONTROL_MASK and keycode in (
self.keycode_c, self.keycode_ins)): self.keycode_c, self.keycode_ins)):
return False return False
if event.get_state() & Gdk.ModifierType.SHIFT_MASK and \ if event.get_state() & Gdk.ModifierType.SHIFT_MASK and \
event.keyval in (Gdk.KEY_Page_Down, Gdk.KEY_Page_Up): event.keyval in (Gdk.KEY_Page_Down, Gdk.KEY_Page_Up):
self._on_scroll(None, event.keyval) self._on_scroll(None, event.keyval)

View File

@ -603,7 +603,7 @@ class Connection(CommonConnection, ConnectionHandlers):
if warn: if warn:
log.warning('only bare JID available') 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)) return nbxmpp.JID(app.get_jid_from_account(self.name))
def reconnect(self): def reconnect(self):

View File

@ -669,16 +669,16 @@ class ConnectionTypeEvent(nec.NetworkIncomingEvent):
class StanzaReceivedEvent(nec.NetworkIncomingEvent): class StanzaReceivedEvent(nec.NetworkIncomingEvent):
name = 'stanza-received' name = 'stanza-received'
def init(self): def init(self):
self.additional_data = {} self.additional_data = {}
def generate(self): def generate(self):
return True return True
class StanzaSentEvent(nec.NetworkIncomingEvent): class StanzaSentEvent(nec.NetworkIncomingEvent):
name = 'stanza-sent' name = 'stanza-sent'
def init(self): def init(self):
self.additional_data = {} self.additional_data = {}

View File

@ -1187,7 +1187,7 @@ class ConversationTextview(GObject.GObject):
text_tags.append('outgoingtxt') text_tags.append('outgoingtxt')
self.print_subject(subject, iter_=iter_) self.print_subject(subject, iter_=iter_)
iter_ = self.print_real_text(text, text_tags, name, xhtml, graphics=graphics, iter_ = self.print_real_text(text, text_tags, name, xhtml, graphics=graphics,
mark=insert_mark, additional_data=additional_data) mark=insert_mark, additional_data=additional_data)

View File

@ -637,7 +637,7 @@ class SingleForm(Gtk.Table):
try: try:
newtext = helpers.parse_jid(newtext) newtext = helpers.parse_jid(newtext)
except helpers.InvalidFormat as s: 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 return
if newtext in field.values: if newtext in field.values:
app.interface.raise_dialog('jid-in-list') app.interface.raise_dialog('jid-in-list')

View File

@ -151,17 +151,17 @@ class PluginManager(metaclass=Singleton):
@log_calls('PluginManager') @log_calls('PluginManager')
def remove_plugin(self, plugin): 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 from sys. This way we will have a fresh start when the plugin gets added
again. again.
''' '''
if plugin.active: if plugin.active:
self.deactivate_plugin(plugin) self.deactivate_plugin(plugin)
self.plugins.remove(plugin) self.plugins.remove(plugin)
# remove modules from cache # 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 # 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 # name to avoid name problems (removing module_abc if base_package is
# module_ab) # module_ab)
@ -170,10 +170,10 @@ class PluginManager(metaclass=Singleton):
# remove the base_package itself # remove the base_package itself
if base_package in sys.modules: if base_package in sys.modules:
modules_to_remove.append(base_package) modules_to_remove.append(base_package)
for module_to_remove in modules_to_remove: for module_to_remove in modules_to_remove:
del sys.modules[module_to_remove] del sys.modules[module_to_remove]
@log_calls('PluginManager') @log_calls('PluginManager')
def add_plugins(self, plugin_classes): def add_plugins(self, plugin_classes):
for plugin_class in plugin_classes: for plugin_class in plugin_classes:

View File

@ -4021,7 +4021,7 @@ class RosterWindow:
# account = row[Column.ACCOUNT] # account = row[Column.ACCOUNT]
# self._last_selected_contact.append((jid, account)) # self._last_selected_contact.append((jid, account))
# GLib.idle_add(self.draw_contact, jid, account, True) # GLib.idle_add(self.draw_contact, jid, account, True)
def on_service_disco_menuitem_activate(self, widget, account): def on_service_disco_menuitem_activate(self, widget, account):
server_jid = app.config.get_per('accounts', account, 'hostname') server_jid = app.config.get_per('accounts', account, 'hostname')
@ -5583,7 +5583,7 @@ class RosterWindow:
if typ in ('contact', 'self_contact'): if typ in ('contact', 'self_contact'):
contacts = app.contacts.get_contacts(account, jid) contacts = app.contacts.get_contacts(account, jid)
for c in contacts: for c in contacts:
if c.show not in ('offline', 'error'): if c.show not in ('offline', 'error'):
connected_contacts.append(c) connected_contacts.append(c)