From e534994ee34e3d95908bafbb54289d9b1220259c Mon Sep 17 00:00:00 2001 From: lakshyacis Date: Mon, 4 Nov 2019 20:15:18 +0530 Subject: [PATCH] class_addressGenerator quality fixes --- src/class_addressGenerator.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/class_addressGenerator.py b/src/class_addressGenerator.py index c7c7e261..9e19cf50 100644 --- a/src/class_addressGenerator.py +++ b/src/class_addressGenerator.py @@ -1,4 +1,6 @@ - +""" +A thread for creating addresses +""" import time import hashlib from binascii import hexlify @@ -18,6 +20,7 @@ from network import StoppableThread class addressGenerator(StoppableThread): + """A thread for creating addresses""" name = "addressGenerator" @@ -33,6 +36,7 @@ class addressGenerator(StoppableThread): Process the requests for addresses generation from `.queues.addressGeneratorQueue` """ + # pylint: disable=too-many-locals, too-many-branches, protected-access, too-many-statements while state.shutdown == 0: queueValue = queues.addressGeneratorQueue.get() nonceTrialsPerByte = 0 @@ -212,7 +216,7 @@ class addressGenerator(StoppableThread): elif command == 'createDeterministicAddresses' \ or command == 'getDeterministicAddress' \ or command == 'createChan' or command == 'joinChan': - if len(deterministicPassphrase) == 0: + if not deterministicPassphrase: self.logger.warning( 'You are creating deterministic' ' address(es) using a blank passphrase.' @@ -361,7 +365,7 @@ class addressGenerator(StoppableThread): address) shared.myECCryptorObjects[ripe] = \ highlevelcrypto.makeCryptor( - hexlify(potentialPrivEncryptionKey)) + hexlify(potentialPrivEncryptionKey)) shared.myAddressesByHash[ripe] = address tag = hashlib.sha512(hashlib.sha512( encodeVarint(addressVersionNumber) +