From 948ee91e04cfdd853b904ef47b94d4a8bffbeb33 Mon Sep 17 00:00:00 2001 From: lakshyacis Date: Wed, 18 Mar 2020 19:30:27 +0530 Subject: [PATCH] quality fixes after inventory issue resolve --- src/class_singleWorker.py | 7 ++++--- src/inventory.py | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/class_singleWorker.py b/src/class_singleWorker.py index e1959796..2c28cf9b 100644 --- a/src/class_singleWorker.py +++ b/src/class_singleWorker.py @@ -1,7 +1,7 @@ """ Thread for performing PoW """ -# pylint: disable=protected-access,too-many-branches,too-many-statements +# pylint: disable=protected-access,too-many-branches,too-many-statements,unused-variable # pylint: disable=no-self-use,too-many-lines,too-many-locals,relative-import @@ -477,6 +477,7 @@ class singleWorker(StoppableThread): def sendOnionPeerObj(self, peer=None): """Send onionpeer object representing peer""" + # pylint: disable=redefined-argument-from-local if not peer: # find own onionhostname for peer in state.ownAddresses: if peer.host.endswith('.onion'): @@ -684,7 +685,7 @@ class singleWorker(StoppableThread): def sendMsg(self): """Send a message-type object (assemble the object, perform PoW and put it to the inv announcement queue)""" - # pylint: disable=too-many-nested-blocks + # pylint: disable=too-many-nested-blocks,logging-format-interpolation,unused-variable # Reset just in case sqlExecute( '''UPDATE sent SET status='msgqueued' ''' @@ -1238,7 +1239,7 @@ class singleWorker(StoppableThread): inventoryHash = calculateInventoryHash(encryptedPayload) objectType = 2 inventoryHashlist = ( - objectType, toStreamNumber,encryptedPayload, embeddedTime, '') + objectType, toStreamNumber, encryptedPayload, embeddedTime, '') Inventory()[inventoryHash] = ( objectType, toStreamNumber, encryptedPayload, embeddedTime, '') if BMConfigParser().has_section(toaddress) or \ diff --git a/src/inventory.py b/src/inventory.py index c3772211..abcc57d2 100644 --- a/src/inventory.py +++ b/src/inventory.py @@ -43,8 +43,8 @@ class Inventory(object): # on python3 we have separately added __setitem__ method def __setitem__(self, hash_, value): - return getattr(self._realInventory,'__setitem__')(hash_,value) + return getattr(self._realInventory, '__setitem__')(hash_, value) # hint for pylint: this is dictionary like object def __getitem__(self, key): - return self._realInventory[key] \ No newline at end of file + return self._realInventory[key]