Fix bad-whitespace pylint errors

This commit is contained in:
Philipp Hörist 2018-09-18 12:06:01 +02:00 committed by Philipp Hörist
parent b2a64fe5cc
commit e842298724
39 changed files with 644 additions and 644 deletions

View File

@ -28,9 +28,10 @@
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
import re
from gi.repository import GLib
from enum import IntEnum, unique
from gi.repository import GLib
import gajim
from gajim.common.i18n import _
@ -52,6 +53,7 @@ opt_one_window_types = ['never', 'always', 'always_with_roster', 'peracct', 'per
opt_show_roster_on_startup = ['always', 'never', 'last_state']
opt_treat_incoming_messages = ['', 'chat', 'normal']
class Config:
DEFAULT_ICONSET = 'dcraven'
@ -422,7 +424,8 @@ class Config:
'contacts': ({
'speller_language': [opt_str, '', _('Language for which misspelled words will be checked')],
}, {}),
'encryption': ({'encryption': [ opt_str, '', _('The currently active encryption for that contact')],
'encryption': ({
'encryption': [opt_str, '', _('The currently active encryption for that contact')],
}, {}),
'rooms': ({
'speller_language': [opt_str, '', _('Language for which misspelled words will be checked')],

View File

@ -293,8 +293,8 @@ class CommonConnection:
addresses = msg_iq.addChild('addresses',
namespace=nbxmpp.NS_ADDRESS)
for j in obj.jid:
addresses.addChild('address', attrs = {'type': 'to',
'jid': j})
addresses.addChild('address',
attrs={'type': 'to', 'jid': j})
else:
iqs = []
for j in obj.jid:

View File

@ -842,8 +842,8 @@ class FileRequestReceivedEvent(nec.NetworkIncomingEvent, HelperEvent):
n = file_tag.getTag('name')
n = n.getData() if n else None
pjid = app.get_jid_without_resource(self.fjid)
file_info = self.conn.get_file_info(pjid, hash_=h,
name=n,account=self.conn.name)
file_info = self.conn.get_file_info(
pjid, hash_=h, name=n, account=self.conn.name)
self.file_props.file_name = file_info['file-name']
self.file_props.sender = self.conn._ft_get_our_jid()
self.file_props.receiver = self.fjid
@ -1246,14 +1246,10 @@ class MessageOutgoingEvent(nec.NetworkOutgoingEvent):
class StanzaMessageOutgoingEvent(nec.NetworkOutgoingEvent):
name = 'stanza-message-outgoing'
def generate(self):
return True
class GcStanzaMessageOutgoingEvent(nec.NetworkOutgoingEvent):
name = 'gc-stanza-message-outgoing'
def generate(self):
return True
class GcMessageOutgoingEvent(nec.NetworkOutgoingEvent):
name = 'gc-message-outgoing'

View File

@ -71,6 +71,7 @@ def parseAndSetLogLevels(arg):
class colors:
# pylint: disable=C0326
NONE = chr(27) + "[0m"
BLACk = chr(27) + "[30m"
RED = chr(27) + "[31m"

View File

@ -24,19 +24,21 @@ import hashlib
import os
import time
import platform
import logging
from errno import EWOULDBLOCK
from errno import ENOBUFS
from errno import EINTR
from errno import EISCONN
from errno import EINPROGRESS
from errno import EAFNOSUPPORT
from nbxmpp.idlequeue import IdleObject
import OpenSSL
from gajim.common.file_props import FilesProp
from gajim.common import app
from gajim.common import jingle_xtls
if jingle_xtls.PYOPENSSL_PRESENT:
import OpenSSL
import logging
log = logging.getLogger('gajim.c.socks5')
MAX_BUFF_LEN = 65536
# after foo seconds without activity label transfer as 'stalled'
@ -411,8 +413,8 @@ class SocksQueue:
if idx != -1:
for key in list(self.readers.keys()):
if idx in key:
self.remove_receiver_by_key(key,
do_disconnect=do_disconnect)
self.remove_receiver_by_key(
key, do_disconnect=do_disconnect)
if not remove_all:
break
@ -1485,4 +1487,3 @@ class Socks5Listener(IdleObject):
_sock[0].setblocking(False)
self.connections.append(_sock[0])
return _sock

View File

@ -153,12 +153,11 @@ class ConversationTextview(GObject.GObject):
Class for the conversation textview (where user reads already said messages)
for chat/groupchat windows
"""
__gsignals__ = dict(
quote = (GObject.SignalFlags.RUN_LAST | GObject.SignalFlags.ACTION,
__gsignals__ = dict(quote=(
GObject.SignalFlags.RUN_LAST | GObject.SignalFlags.ACTION,
None, # return value
(str, ) # arguments
)
)
))
def __init__(self, account, used_in_history_window=False):
"""

View File

@ -21,20 +21,20 @@ Words single and multiple refers here to types of data forms:
single means these with one record of data (without <reported/> element),
multiple - these which may contain more data (with <reported/> element).'''
import itertools
import base64
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GdkPixbuf
from gi.repository import GObject
from gi.repository import GLib
import base64
from gajim import gtkgui_helpers
from gajim.common.modules import dataforms
from gajim.common import helpers
from gajim.common import app
import itertools
class DataFormWidget(Gtk.Alignment):
# "public" interface
@ -42,9 +42,8 @@ class DataFormWidget(Gtk.Alignment):
Data Form widget. Use like any other widget
"""
__gsignals__ = dict(
validated = (GObject.SignalFlags.RUN_LAST | GObject.SignalFlags.ACTION, None, ())
)
__gsignals__ = dict(validated=(
GObject.SignalFlags.RUN_LAST | GObject.SignalFlags.ACTION, None, ()))
def __init__(self, dataformnode=None):
''' Create a widget. '''
@ -313,8 +312,8 @@ class SingleForm(Gtk.Table):
forms, it is in another class
"""
__gsignals__ = dict(
validated = (GObject.SignalFlags.RUN_LAST | GObject.SignalFlags.ACTION, None, ())
__gsignals__ = dict(validated=(
GObject.SignalFlags.RUN_LAST | GObject.SignalFlags.ACTION, None, ())
)
def __init__(self, dataform, selectable=False):

View File

@ -1366,8 +1366,8 @@ class ToplevelAgentBrowser(AgentBrowser):
# Guess what kind of service we're dealing with
if self.browse_button:
jid = model[iter_][0]
type_ = app.get_transport_name_from_jid(jid,
use_config_setting = False)
type_ = app.get_transport_name_from_jid(
jid, use_config_setting=False)
if type_:
identity = {'category': '_jid', 'type': type_}
klass = self.cache.get_browser([identity])
@ -1533,8 +1533,8 @@ class ToplevelAgentBrowser(AgentBrowser):
descr = "<b>%s</b>" % addr
# Guess which kind of service this is
identities = []
type_ = app.get_transport_name_from_jid(jid,
use_config_setting = False)
type_ = app.get_transport_name_from_jid(
jid, use_config_setting=False)
if type_:
identity = {'category': '_jid', 'type': type_}
identities.append(identity)
@ -1975,8 +1975,8 @@ class DiscussionGroupsBrowser(AgentBrowser):
parent_iter = None
if not node or not self._in_list(node):
self.model.append(parent_iter, (jid, node, name, dunno, subscribed))
self.cache.get_items(jid, node, self._add_items, force = force,
args = (force,))
self.cache.get_items(
jid, node, self._add_items, force=force, args=(force,))
def _get_child_iter(self, parent_iter, node):
child_iter = self.model.iter_children(parent_iter)

View File

@ -557,7 +557,8 @@ class MessageWindow:
else: # We are leaving gc without status message or it's a chat
ctrl.shutdown()
# Update external state
app.events.remove_events(ctrl.account, ctrl.get_full_jid,
app.events.remove_events(
ctrl.account, ctrl.get_full_jid,
types=['printed_msg', 'chat', 'gc_msg'])
fjid = ctrl.get_full_jid()

View File

@ -119,9 +119,9 @@ class Singleton(type):
super(Singleton, cls).__init__(name, bases, dic)
cls.instance = None
def __call__(cls,*args,**kw):
def __call__(cls, *args, **kwargs):
if cls.instance is None:
cls.instance=super(Singleton, cls).__call__(*args,**kw)
cls.instance = super(Singleton, cls).__call__(*args, **kwargs)
#log.debug('%(classname)s - new instance created'%{
#'classname' : cls.__name__})
else: