From 01d4fbe60b934ad1997d824e484a359bbe658af6 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Mon, 6 May 2019 13:05:21 +0300 Subject: [PATCH] Resolved pylint warnings --- src/class_objectProcessor.py | 8 ++++++-- src/class_singleWorker.py | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/class_objectProcessor.py b/src/class_objectProcessor.py index 9a7188b7..1ced704c 100644 --- a/src/class_objectProcessor.py +++ b/src/class_objectProcessor.py @@ -143,7 +143,9 @@ class objectProcessor(threading.Thread): else: logger.debug('This object is not an acknowledgement bound for me.') - def processonion(self, data): + @staticmethod + def processonion(data): + """Process onionpeer object""" readPosition = 20 # bypass the nonce, time, and object type length = decodeVarint(data[readPosition:readPosition + 10])[1] readPosition += length @@ -160,7 +162,9 @@ class objectProcessor(threading.Thread): knownnodes.addKnownNode( stream, peer, is_self=state.ownAddresses.get(peer)) - def processgetpubkey(self, data): + @staticmethod + def processgetpubkey(data): + """Process getpubkey object""" if len(data) > 200: logger.info( 'getpubkey is abnormally long. Sanity check failed.' diff --git a/src/class_singleWorker.py b/src/class_singleWorker.py index d8f70ada..5076e0ce 100644 --- a/src/class_singleWorker.py +++ b/src/class_singleWorker.py @@ -130,7 +130,7 @@ class singleWorker(threading.Thread, StoppableThread): queues.workerQueue.put(('sendbroadcast', '')) # send onionpeer object - for peer in state.ownAddresses.keys(): + for peer in state.ownAddresses: if peer.host.endswith('.onion'): queues.workerQueue.put(('sendOnionPeerObj', peer)) break @@ -470,6 +470,7 @@ class singleWorker(threading.Thread, StoppableThread): ) def sendOnionPeerObj(self, peer): + """Send onionpeer object representing peer""" TTL = int(7 * 24 * 60 * 60 + helper_random.randomrandrange(-300, 300)) embeddedTime = int(time.time() + TTL) streamNumber = 1 # Don't know yet what should be here