From fbfbc560c6270f6b4bfee4a5b58c4b5ec695e3c0 Mon Sep 17 00:00:00 2001 From: "kuldeep.k@cisinlabs.com" Date: Fri, 17 Dec 2021 19:04:10 +0530 Subject: [PATCH] Fixed pylint --- src/tests/mock/bitmessagemock.py | 2 +- src/tests/mock/pybitmessage/bmconfigparser.py | 2 ++ src/tests/mock/pybitmessage/class_addressGenerator.py | 9 ++------- src/tests/mock/pybitmessage/class_singleWorker.py | 6 +++--- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/tests/mock/bitmessagemock.py b/src/tests/mock/bitmessagemock.py index 7b6851be..c58c9c88 100644 --- a/src/tests/mock/bitmessagemock.py +++ b/src/tests/mock/bitmessagemock.py @@ -8,7 +8,7 @@ from pybitmessage.inventory import Inventory from pybitmessage.bmconfigparser import BMConfigParser -# pylint: disable=too-few-public-methods +# pylint: disable=too-few-public-methods,no-init,old-style-class class MockMain: """Mock main function""" diff --git a/src/tests/mock/pybitmessage/bmconfigparser.py b/src/tests/mock/pybitmessage/bmconfigparser.py index 4798dda4..efeac69b 100644 --- a/src/tests/mock/pybitmessage/bmconfigparser.py +++ b/src/tests/mock/pybitmessage/bmconfigparser.py @@ -69,6 +69,7 @@ class BMConfigParser(SafeConfigParser): raise ValueError("Invalid value %s" % value) return SafeConfigParser.set(self, section, option, value) + # pylint: disable=redefined-builtinm, too-many-return-statements def get(self, section, option, raw=False, vars=None): if sys.version_info[0] == 3: # pylint: disable=arguments-differ @@ -185,6 +186,7 @@ class BMConfigParser(SafeConfigParser): for section in self.sections(): for option in self.options(section): try: + # pylint: disable=unsubscriptable-object if not self.validate( section, option, self[section][option] diff --git a/src/tests/mock/pybitmessage/class_addressGenerator.py b/src/tests/mock/pybitmessage/class_addressGenerator.py index b86e9278..e5f59675 100644 --- a/src/tests/mock/pybitmessage/class_addressGenerator.py +++ b/src/tests/mock/pybitmessage/class_addressGenerator.py @@ -2,10 +2,6 @@ A thread for creating addresses """ -import logging -import random -import threading - from six.moves import queue from pybitmessage import state @@ -46,19 +42,18 @@ class addressGenerator(StoppableThread): address_list = list(fake_addresses.keys()) def stopThread(self): - + """"To stop address generator thread""" try: queues.addressGeneratorQueue.put(("stopThread", "data")) except queue.Full: self.logger.warning('addressGeneratorQueue is Full') - super(FakeAddressGenerator, self).stopThread() + super(addressGenerator, self).stopThread() def run(self): """ Process the requests for addresses generation from `.queues.addressGeneratorQueue` """ - import pdb;pdb.set_trace() while state.shutdown == 0: queueValue = queues.addressGeneratorQueue.get() try: diff --git a/src/tests/mock/pybitmessage/class_singleWorker.py b/src/tests/mock/pybitmessage/class_singleWorker.py index 924db8eb..617e835f 100644 --- a/src/tests/mock/pybitmessage/class_singleWorker.py +++ b/src/tests/mock/pybitmessage/class_singleWorker.py @@ -4,11 +4,11 @@ Thread for performing PoW from __future__ import division +from six.moves import queue + from pybitmessage import state from pybitmessage import queues - from pybitmessage.threads import StoppableThread -from six.moves import queue class singleWorker(StoppableThread): @@ -28,7 +28,7 @@ class singleWorker(StoppableThread): super(singleWorker, self).stopThread() def run(self): - + """To run single worker thread""" if state.shutdown > 0: return