Fixed pylint
This commit is contained in:
parent
a9fb41821a
commit
fbfbc560c6
|
@ -8,7 +8,7 @@ from pybitmessage.inventory import Inventory
|
||||||
from pybitmessage.bmconfigparser import BMConfigParser
|
from pybitmessage.bmconfigparser import BMConfigParser
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=too-few-public-methods
|
# pylint: disable=too-few-public-methods,no-init,old-style-class
|
||||||
class MockMain:
|
class MockMain:
|
||||||
"""Mock main function"""
|
"""Mock main function"""
|
||||||
|
|
||||||
|
|
|
@ -69,6 +69,7 @@ class BMConfigParser(SafeConfigParser):
|
||||||
raise ValueError("Invalid value %s" % value)
|
raise ValueError("Invalid value %s" % value)
|
||||||
return SafeConfigParser.set(self, section, option, 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):
|
def get(self, section, option, raw=False, vars=None):
|
||||||
if sys.version_info[0] == 3:
|
if sys.version_info[0] == 3:
|
||||||
# pylint: disable=arguments-differ
|
# pylint: disable=arguments-differ
|
||||||
|
@ -185,6 +186,7 @@ class BMConfigParser(SafeConfigParser):
|
||||||
for section in self.sections():
|
for section in self.sections():
|
||||||
for option in self.options(section):
|
for option in self.options(section):
|
||||||
try:
|
try:
|
||||||
|
# pylint: disable=unsubscriptable-object
|
||||||
if not self.validate(
|
if not self.validate(
|
||||||
section, option,
|
section, option,
|
||||||
self[section][option]
|
self[section][option]
|
||||||
|
|
|
@ -2,10 +2,6 @@
|
||||||
A thread for creating addresses
|
A thread for creating addresses
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import logging
|
|
||||||
import random
|
|
||||||
import threading
|
|
||||||
|
|
||||||
from six.moves import queue
|
from six.moves import queue
|
||||||
|
|
||||||
from pybitmessage import state
|
from pybitmessage import state
|
||||||
|
@ -46,19 +42,18 @@ class addressGenerator(StoppableThread):
|
||||||
address_list = list(fake_addresses.keys())
|
address_list = list(fake_addresses.keys())
|
||||||
|
|
||||||
def stopThread(self):
|
def stopThread(self):
|
||||||
|
""""To stop address generator thread"""
|
||||||
try:
|
try:
|
||||||
queues.addressGeneratorQueue.put(("stopThread", "data"))
|
queues.addressGeneratorQueue.put(("stopThread", "data"))
|
||||||
except queue.Full:
|
except queue.Full:
|
||||||
self.logger.warning('addressGeneratorQueue is Full')
|
self.logger.warning('addressGeneratorQueue is Full')
|
||||||
super(FakeAddressGenerator, self).stopThread()
|
super(addressGenerator, self).stopThread()
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
"""
|
"""
|
||||||
Process the requests for addresses generation
|
Process the requests for addresses generation
|
||||||
from `.queues.addressGeneratorQueue`
|
from `.queues.addressGeneratorQueue`
|
||||||
"""
|
"""
|
||||||
import pdb;pdb.set_trace()
|
|
||||||
while state.shutdown == 0:
|
while state.shutdown == 0:
|
||||||
queueValue = queues.addressGeneratorQueue.get()
|
queueValue = queues.addressGeneratorQueue.get()
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -4,11 +4,11 @@ Thread for performing PoW
|
||||||
|
|
||||||
from __future__ import division
|
from __future__ import division
|
||||||
|
|
||||||
|
from six.moves import queue
|
||||||
|
|
||||||
from pybitmessage import state
|
from pybitmessage import state
|
||||||
from pybitmessage import queues
|
from pybitmessage import queues
|
||||||
|
|
||||||
from pybitmessage.threads import StoppableThread
|
from pybitmessage.threads import StoppableThread
|
||||||
from six.moves import queue
|
|
||||||
|
|
||||||
|
|
||||||
class singleWorker(StoppableThread):
|
class singleWorker(StoppableThread):
|
||||||
|
@ -28,7 +28,7 @@ class singleWorker(StoppableThread):
|
||||||
super(singleWorker, self).stopThread()
|
super(singleWorker, self).stopThread()
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
"""To run single worker thread"""
|
||||||
if state.shutdown > 0:
|
if state.shutdown > 0:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user