Fixed pylint

This commit is contained in:
kuldeep.k@cisinlabs.com 2021-12-17 19:04:10 +05:30
parent a9fb41821a
commit fbfbc560c6
No known key found for this signature in database
GPG Key ID: AF4FB299BF7C7C2A
4 changed files with 8 additions and 11 deletions

View File

@ -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"""

View File

@ -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]

View File

@ -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:

View File

@ -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