Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,10 @@ class ErrorCodes(type):
28: 'Invalid parameter'
}

# pylint: disable=no-member
def __new__(mcs, name, bases, namespace):
result = super(ErrorCodes, mcs).__new__(mcs, name, bases, namespace)
for code in six.iteritems(mcs._CODES): # pylint: disable=no-member
for code in six.iteritems(mcs._CODES):
# beware: the formatting is adjusted for list-table
result.__doc__ += """ * - %04i
- %s
Expand Down
12 changes: 7 additions & 5 deletions src/bitmessageqt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1921,7 +1921,7 @@ def updateSentItemStatusByToAddress(self, toAddress, textToDisplay):
sent.item(i, 3).setText(textToDisplay)

def updateSentItemStatusByAckdata(self, ackdata, textToDisplay):
if type(ackdata) is str:
if isinstance(ackdata, str):
ackdata = QtCore.QByteArray(ackdata)
for sent in (
self.ui.tableWidgetInbox,
Expand Down Expand Up @@ -3193,7 +3193,7 @@ def deleteRowFromMessagelist(
self.ui.tableWidgetInboxChans,
self.ui.tableWidgetInboxSubscriptions
)
elif type(messageLists) not in (list, tuple):
elif not isinstance(messageLists, (list, tuple)):
messageLists = (messageLists,)
for messageList in messageLists:
if row is not None:
Expand Down Expand Up @@ -4141,6 +4141,7 @@ def tableWidgetInboxItemClicked(self):
except NameError:
message = ""
except IndexError:
# pylint: disable=redefined-variable-type
message = _translate(
"MainWindow",
"Error occurred: could not load message from disk."
Expand Down Expand Up @@ -4168,9 +4169,10 @@ def tableWidgetAddressBookItemChanged(self, item):
self.rerenderMessagelistFromLabels()
self.rerenderMessagelistToLabels()
completerList = self.ui.lineEditTo.completer().model().stringList()
for i in range(len(completerList)):
if text_type(completerList[i]).endswith(" <" + item.address + ">"):
completerList[i] = item.label + " <" + item.address + ">"
for index_, string_ in enumerate(completerList):
if text_type(string_).endswith(" <" + item.address + ">"):
completerList[index_] = item.label + " <" \
+ item.address + ">"
self.ui.lineEditTo.completer().model().setStringList(completerList)

def tabWidgetCurrentChanged(self, n):
Expand Down
2 changes: 1 addition & 1 deletion src/network/asyncore_pollchoose.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ def loop(timeout=30.0, use_poll=False, map=None, count=None, poller=None):
# then poll
poller(subtimeout, map)
if isinstance(count, int):
count = count - 1
count = count - 1 # pylint: disable=redefined-variable-type


class dispatcher(object):
Expand Down
1 change: 1 addition & 0 deletions src/network/tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
class TLSDispatcher(AdvancedDispatcher):
"""TLS functionality for classes derived from AdvancedDispatcher"""
# pylint: disable=too-many-instance-attributes,super-init-not-called
# pylint: disable=unused-argument
def __init__(self, _=None, sock=None, certfile=None, keyfile=None,
server_side=False, ciphers=sslProtocolCiphers):
self.want_read = self.want_write = True
Expand Down
4 changes: 3 additions & 1 deletion src/network/udp.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
logger = logging.getLogger('default')


class UDPSocket(BMProto): # pylint: disable=too-many-instance-attributes
# pylint: disable=too-many-instance-attributes
# pylint: disable=no-self-use
class UDPSocket(BMProto):
"""Bitmessage protocol over UDP (class)"""
port = 8444

Expand Down
1 change: 1 addition & 0 deletions src/tests/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def setUpClass(cls):

try:
pid = int(cls._get_readline('singleton.lock'))
# pylint: disable=redefined-variable-type
cls.process = psutil.Process(pid)
time.sleep(5)
except (psutil.NoSuchProcess, TypeError):
Expand Down
11 changes: 9 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ basepython = python2.7
deps =
-rrequirements.txt
pylint<2.0.0
commands = pylint --rcfile=tox.ini --exit-zero --ignore=bitmessagekivy pybitmessage
commands = pylint --rcfile=tox.ini --ignore=bitmessagekivy pybitmessage

[testenv:py27]
sitepackages = true
Expand Down Expand Up @@ -170,7 +170,14 @@ disable =
invalid-name,consider-using-f-string,fixme,raise-missing-from,
relative-import,super-with-arguments,unnecessary-pass,unknown-option-value,
unspecified-encoding,useless-object-inheritance,useless-option-value,
bad-option-value
bad-option-value,missing-docstring,import-error,wrong-import-order,
inconsistent-return-statements,super-init-not-called,bad-continuation,
no-member,ungrouped-imports,wrong-import-position,len-as-condition,
redefined-argument-from-local,too-few-public-methods,
attribute-defined-outside-init,duplicate-code,too-many-statements,
too-many-locals,too-many-instance-attributes,unneeded-not,
no-else-return,access-member-before-definition,
too-many-public-methods

[pylint.design]
max-args = 8
Expand Down
Loading