Fix bad-whitespace pylint errors
This commit is contained in:
parent
b2a64fe5cc
commit
e842298724
|
@ -28,9 +28,10 @@
|
||||||
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
|
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import re
|
import re
|
||||||
from gi.repository import GLib
|
|
||||||
from enum import IntEnum, unique
|
from enum import IntEnum, unique
|
||||||
|
|
||||||
|
from gi.repository import GLib
|
||||||
|
|
||||||
import gajim
|
import gajim
|
||||||
from gajim.common.i18n import _
|
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_show_roster_on_startup = ['always', 'never', 'last_state']
|
||||||
opt_treat_incoming_messages = ['', 'chat', 'normal']
|
opt_treat_incoming_messages = ['', 'chat', 'normal']
|
||||||
|
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
|
|
||||||
DEFAULT_ICONSET = 'dcraven'
|
DEFAULT_ICONSET = 'dcraven'
|
||||||
|
@ -422,7 +424,8 @@ class Config:
|
||||||
'contacts': ({
|
'contacts': ({
|
||||||
'speller_language': [opt_str, '', _('Language for which misspelled words will be checked')],
|
'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': ({
|
'rooms': ({
|
||||||
'speller_language': [opt_str, '', _('Language for which misspelled words will be checked')],
|
'speller_language': [opt_str, '', _('Language for which misspelled words will be checked')],
|
||||||
|
|
|
@ -293,8 +293,8 @@ class CommonConnection:
|
||||||
addresses = msg_iq.addChild('addresses',
|
addresses = msg_iq.addChild('addresses',
|
||||||
namespace=nbxmpp.NS_ADDRESS)
|
namespace=nbxmpp.NS_ADDRESS)
|
||||||
for j in obj.jid:
|
for j in obj.jid:
|
||||||
addresses.addChild('address', attrs = {'type': 'to',
|
addresses.addChild('address',
|
||||||
'jid': j})
|
attrs={'type': 'to', 'jid': j})
|
||||||
else:
|
else:
|
||||||
iqs = []
|
iqs = []
|
||||||
for j in obj.jid:
|
for j in obj.jid:
|
||||||
|
|
|
@ -842,8 +842,8 @@ class FileRequestReceivedEvent(nec.NetworkIncomingEvent, HelperEvent):
|
||||||
n = file_tag.getTag('name')
|
n = file_tag.getTag('name')
|
||||||
n = n.getData() if n else None
|
n = n.getData() if n else None
|
||||||
pjid = app.get_jid_without_resource(self.fjid)
|
pjid = app.get_jid_without_resource(self.fjid)
|
||||||
file_info = self.conn.get_file_info(pjid, hash_=h,
|
file_info = self.conn.get_file_info(
|
||||||
name=n,account=self.conn.name)
|
pjid, hash_=h, name=n, account=self.conn.name)
|
||||||
self.file_props.file_name = file_info['file-name']
|
self.file_props.file_name = file_info['file-name']
|
||||||
self.file_props.sender = self.conn._ft_get_our_jid()
|
self.file_props.sender = self.conn._ft_get_our_jid()
|
||||||
self.file_props.receiver = self.fjid
|
self.file_props.receiver = self.fjid
|
||||||
|
@ -1246,14 +1246,10 @@ class MessageOutgoingEvent(nec.NetworkOutgoingEvent):
|
||||||
class StanzaMessageOutgoingEvent(nec.NetworkOutgoingEvent):
|
class StanzaMessageOutgoingEvent(nec.NetworkOutgoingEvent):
|
||||||
name = 'stanza-message-outgoing'
|
name = 'stanza-message-outgoing'
|
||||||
|
|
||||||
def generate(self):
|
|
||||||
return True
|
|
||||||
|
|
||||||
class GcStanzaMessageOutgoingEvent(nec.NetworkOutgoingEvent):
|
class GcStanzaMessageOutgoingEvent(nec.NetworkOutgoingEvent):
|
||||||
name = 'gc-stanza-message-outgoing'
|
name = 'gc-stanza-message-outgoing'
|
||||||
|
|
||||||
def generate(self):
|
|
||||||
return True
|
|
||||||
|
|
||||||
class GcMessageOutgoingEvent(nec.NetworkOutgoingEvent):
|
class GcMessageOutgoingEvent(nec.NetworkOutgoingEvent):
|
||||||
name = 'gc-message-outgoing'
|
name = 'gc-message-outgoing'
|
||||||
|
|
|
@ -71,6 +71,7 @@ def parseAndSetLogLevels(arg):
|
||||||
|
|
||||||
|
|
||||||
class colors:
|
class colors:
|
||||||
|
# pylint: disable=C0326
|
||||||
NONE = chr(27) + "[0m"
|
NONE = chr(27) + "[0m"
|
||||||
BLACk = chr(27) + "[30m"
|
BLACk = chr(27) + "[30m"
|
||||||
RED = chr(27) + "[31m"
|
RED = chr(27) + "[31m"
|
||||||
|
|
|
@ -24,19 +24,21 @@ import hashlib
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
import platform
|
import platform
|
||||||
|
import logging
|
||||||
from errno import EWOULDBLOCK
|
from errno import EWOULDBLOCK
|
||||||
from errno import ENOBUFS
|
from errno import ENOBUFS
|
||||||
from errno import EINTR
|
from errno import EINTR
|
||||||
from errno import EISCONN
|
from errno import EISCONN
|
||||||
from errno import EINPROGRESS
|
from errno import EINPROGRESS
|
||||||
from errno import EAFNOSUPPORT
|
from errno import EAFNOSUPPORT
|
||||||
|
|
||||||
from nbxmpp.idlequeue import IdleObject
|
from nbxmpp.idlequeue import IdleObject
|
||||||
|
import OpenSSL
|
||||||
|
|
||||||
from gajim.common.file_props import FilesProp
|
from gajim.common.file_props import FilesProp
|
||||||
from gajim.common import app
|
from gajim.common import app
|
||||||
from gajim.common import jingle_xtls
|
from gajim.common import jingle_xtls
|
||||||
if jingle_xtls.PYOPENSSL_PRESENT:
|
|
||||||
import OpenSSL
|
|
||||||
import logging
|
|
||||||
log = logging.getLogger('gajim.c.socks5')
|
log = logging.getLogger('gajim.c.socks5')
|
||||||
MAX_BUFF_LEN = 65536
|
MAX_BUFF_LEN = 65536
|
||||||
# after foo seconds without activity label transfer as 'stalled'
|
# after foo seconds without activity label transfer as 'stalled'
|
||||||
|
@ -411,8 +413,8 @@ class SocksQueue:
|
||||||
if idx != -1:
|
if idx != -1:
|
||||||
for key in list(self.readers.keys()):
|
for key in list(self.readers.keys()):
|
||||||
if idx in key:
|
if idx in key:
|
||||||
self.remove_receiver_by_key(key,
|
self.remove_receiver_by_key(
|
||||||
do_disconnect=do_disconnect)
|
key, do_disconnect=do_disconnect)
|
||||||
if not remove_all:
|
if not remove_all:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
@ -1485,4 +1487,3 @@ class Socks5Listener(IdleObject):
|
||||||
_sock[0].setblocking(False)
|
_sock[0].setblocking(False)
|
||||||
self.connections.append(_sock[0])
|
self.connections.append(_sock[0])
|
||||||
return _sock
|
return _sock
|
||||||
|
|
||||||
|
|
|
@ -153,12 +153,11 @@ class ConversationTextview(GObject.GObject):
|
||||||
Class for the conversation textview (where user reads already said messages)
|
Class for the conversation textview (where user reads already said messages)
|
||||||
for chat/groupchat windows
|
for chat/groupchat windows
|
||||||
"""
|
"""
|
||||||
__gsignals__ = dict(
|
__gsignals__ = dict(quote=(
|
||||||
quote = (GObject.SignalFlags.RUN_LAST | GObject.SignalFlags.ACTION,
|
GObject.SignalFlags.RUN_LAST | GObject.SignalFlags.ACTION,
|
||||||
None, # return value
|
None, # return value
|
||||||
(str, ) # arguments
|
(str, ) # arguments
|
||||||
)
|
))
|
||||||
)
|
|
||||||
|
|
||||||
def __init__(self, account, used_in_history_window=False):
|
def __init__(self, account, used_in_history_window=False):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -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),
|
single means these with one record of data (without <reported/> element),
|
||||||
multiple - these which may contain more data (with <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 Gtk
|
||||||
from gi.repository import Gdk
|
from gi.repository import Gdk
|
||||||
from gi.repository import GdkPixbuf
|
from gi.repository import GdkPixbuf
|
||||||
from gi.repository import GObject
|
from gi.repository import GObject
|
||||||
from gi.repository import GLib
|
from gi.repository import GLib
|
||||||
import base64
|
|
||||||
|
|
||||||
from gajim import gtkgui_helpers
|
from gajim import gtkgui_helpers
|
||||||
|
|
||||||
from gajim.common.modules import dataforms
|
from gajim.common.modules import dataforms
|
||||||
from gajim.common import helpers
|
from gajim.common import helpers
|
||||||
from gajim.common import app
|
from gajim.common import app
|
||||||
|
|
||||||
import itertools
|
|
||||||
|
|
||||||
class DataFormWidget(Gtk.Alignment):
|
class DataFormWidget(Gtk.Alignment):
|
||||||
# "public" interface
|
# "public" interface
|
||||||
|
@ -42,9 +42,8 @@ class DataFormWidget(Gtk.Alignment):
|
||||||
Data Form widget. Use like any other widget
|
Data Form widget. Use like any other widget
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__gsignals__ = dict(
|
__gsignals__ = dict(validated=(
|
||||||
validated = (GObject.SignalFlags.RUN_LAST | GObject.SignalFlags.ACTION, None, ())
|
GObject.SignalFlags.RUN_LAST | GObject.SignalFlags.ACTION, None, ()))
|
||||||
)
|
|
||||||
|
|
||||||
def __init__(self, dataformnode=None):
|
def __init__(self, dataformnode=None):
|
||||||
''' Create a widget. '''
|
''' Create a widget. '''
|
||||||
|
@ -313,8 +312,8 @@ class SingleForm(Gtk.Table):
|
||||||
forms, it is in another class
|
forms, it is in another class
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__gsignals__ = dict(
|
__gsignals__ = dict(validated=(
|
||||||
validated = (GObject.SignalFlags.RUN_LAST | GObject.SignalFlags.ACTION, None, ())
|
GObject.SignalFlags.RUN_LAST | GObject.SignalFlags.ACTION, None, ())
|
||||||
)
|
)
|
||||||
|
|
||||||
def __init__(self, dataform, selectable=False):
|
def __init__(self, dataform, selectable=False):
|
||||||
|
|
|
@ -1366,8 +1366,8 @@ class ToplevelAgentBrowser(AgentBrowser):
|
||||||
# Guess what kind of service we're dealing with
|
# Guess what kind of service we're dealing with
|
||||||
if self.browse_button:
|
if self.browse_button:
|
||||||
jid = model[iter_][0]
|
jid = model[iter_][0]
|
||||||
type_ = app.get_transport_name_from_jid(jid,
|
type_ = app.get_transport_name_from_jid(
|
||||||
use_config_setting = False)
|
jid, use_config_setting=False)
|
||||||
if type_:
|
if type_:
|
||||||
identity = {'category': '_jid', 'type': type_}
|
identity = {'category': '_jid', 'type': type_}
|
||||||
klass = self.cache.get_browser([identity])
|
klass = self.cache.get_browser([identity])
|
||||||
|
@ -1533,8 +1533,8 @@ class ToplevelAgentBrowser(AgentBrowser):
|
||||||
descr = "<b>%s</b>" % addr
|
descr = "<b>%s</b>" % addr
|
||||||
# Guess which kind of service this is
|
# Guess which kind of service this is
|
||||||
identities = []
|
identities = []
|
||||||
type_ = app.get_transport_name_from_jid(jid,
|
type_ = app.get_transport_name_from_jid(
|
||||||
use_config_setting = False)
|
jid, use_config_setting=False)
|
||||||
if type_:
|
if type_:
|
||||||
identity = {'category': '_jid', 'type': type_}
|
identity = {'category': '_jid', 'type': type_}
|
||||||
identities.append(identity)
|
identities.append(identity)
|
||||||
|
@ -1975,8 +1975,8 @@ class DiscussionGroupsBrowser(AgentBrowser):
|
||||||
parent_iter = None
|
parent_iter = None
|
||||||
if not node or not self._in_list(node):
|
if not node or not self._in_list(node):
|
||||||
self.model.append(parent_iter, (jid, node, name, dunno, subscribed))
|
self.model.append(parent_iter, (jid, node, name, dunno, subscribed))
|
||||||
self.cache.get_items(jid, node, self._add_items, force = force,
|
self.cache.get_items(
|
||||||
args = (force,))
|
jid, node, self._add_items, force=force, args=(force,))
|
||||||
|
|
||||||
def _get_child_iter(self, parent_iter, node):
|
def _get_child_iter(self, parent_iter, node):
|
||||||
child_iter = self.model.iter_children(parent_iter)
|
child_iter = self.model.iter_children(parent_iter)
|
||||||
|
|
|
@ -557,7 +557,8 @@ class MessageWindow:
|
||||||
else: # We are leaving gc without status message or it's a chat
|
else: # We are leaving gc without status message or it's a chat
|
||||||
ctrl.shutdown()
|
ctrl.shutdown()
|
||||||
# Update external state
|
# 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'])
|
types=['printed_msg', 'chat', 'gc_msg'])
|
||||||
|
|
||||||
fjid = ctrl.get_full_jid()
|
fjid = ctrl.get_full_jid()
|
||||||
|
|
|
@ -119,9 +119,9 @@ class Singleton(type):
|
||||||
super(Singleton, cls).__init__(name, bases, dic)
|
super(Singleton, cls).__init__(name, bases, dic)
|
||||||
cls.instance = None
|
cls.instance = None
|
||||||
|
|
||||||
def __call__(cls,*args,**kw):
|
def __call__(cls, *args, **kwargs):
|
||||||
if cls.instance is None:
|
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'%{
|
#log.debug('%(classname)s - new instance created'%{
|
||||||
#'classname' : cls.__name__})
|
#'classname' : cls.__name__})
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue