WIP: Added mock code #1883
@ -1,3 +1,36 @@
|
||||
|
||||
from class_addressGenerator import FakeAddressGenerator
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
from class_singleWorker import MockSingleWorker
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
from class_objectProcessor import MockObjectProcessor
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
from inventory import MockInventory
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
def main():
|
||||
"""Mock main function"""
|
||||
pass
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
def start(self):
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
"""Start main application"""
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
# pylint: disable=too-many-statements,too-many-branches,too-many-locals
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
config = BMConfigParser()
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
daemon = config.safeGetBoolean('bitmessagesettings', 'daemon')
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
# Start the address generation thread
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
addressGeneratorThread = addressGenerator()
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
# close the main program even if there are threads left
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
addressGeneratorThread.daemon = True
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
addressGeneratorThread.start()
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
# Start the thread that calculates POWs
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
singleWorkerThread = MockSingleWorker()
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
# close the main program even if there are threads left
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
singleWorkerThread.daemon = True
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
singleWorkerThread.start()
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
# Start the thread that calculates POWs
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
objectProcessorThread = MockObjectProcessor()
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
# DON'T close the main program even the thread remains.
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
# This thread checks the shutdown variable after processing
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
# each object.
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
objectProcessorThread.daemon = False
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
objectProcessorThread.start()
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
MockInventory() # init
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
||||
|
||||
![]() here it can start launching the mock threads. here it can start launching the mock threads.
![]() here it can start launching the mock threads. here it can start launching the mock threads.
|
@ -15,7 +15,7 @@ from network import bmproto
|
||||
![]() 25 - 41 - remove 25 - 41 - remove
![]() 25 - 41 - remove 25 - 41 - remove
|
||||
logger = logging.getLogger('default')
|
||||
|
||||
|
||||
class objectProcessor(threading.Thread):
|
||||
![]() 25 - 41 - remove 25 - 41 - remove
|
||||
class MockObjectProcessor(threading.Thread):
|
||||
![]() 25 - 41 - remove 25 - 41 - remove
|
||||
"""
|
||||
The objectProcessor thread, of which there is only one, receives network
|
||||
objects (msg, broadcast, pubkey, getpubkey) from the receiveDataThreads.
|
||||
|
||||
![]() 25 - 41 - remove 25 - 41 - remove
![]() 25 - 41 - remove 25 - 41 - remove
|
here it can start launching the mock threads.
here it can start launching the mock threads.