Move test mode into state
- test mode variable is now in state
This commit is contained in:
parent
1a76c1df97
commit
bf8c2f44f6
|
@ -221,12 +221,12 @@ class Main:
|
||||||
elif opt in ("-c", "--curses"):
|
elif opt in ("-c", "--curses"):
|
||||||
state.curses = True
|
state.curses = True
|
||||||
elif opt in ("-t", "test"):
|
elif opt in ("-t", "test"):
|
||||||
daemon = 10
|
state.testmode = True
|
||||||
|
|
||||||
# is the application already running? If yes then exit.
|
# is the application already running? If yes then exit.
|
||||||
shared.thisapp = singleinstance("", daemon)
|
shared.thisapp = singleinstance("", daemon)
|
||||||
|
|
||||||
if daemon == 1:
|
if daemon:
|
||||||
with shared.printLock:
|
with shared.printLock:
|
||||||
print('Running as a daemon. Send TERM signal to end.')
|
print('Running as a daemon. Send TERM signal to end.')
|
||||||
self.daemonize()
|
self.daemonize()
|
||||||
|
@ -343,11 +343,10 @@ class Main:
|
||||||
else:
|
else:
|
||||||
BMConfigParser().remove_option('bitmessagesettings', 'dontconnect')
|
BMConfigParser().remove_option('bitmessagesettings', 'dontconnect')
|
||||||
|
|
||||||
if daemon:
|
if state.testmode:
|
||||||
sleep(daemon)
|
sleep(10)
|
||||||
if daemon > 1:
|
self.stop()
|
||||||
# make testing
|
if daemon or state.testmode:
|
||||||
self.stop()
|
|
||||||
while state.shutdown == 0:
|
while state.shutdown == 0:
|
||||||
sleep(1)
|
sleep(1)
|
||||||
|
|
||||||
|
|
|
@ -55,3 +55,5 @@ def resetNetworkProtocolAvailability():
|
||||||
resetNetworkProtocolAvailability()
|
resetNetworkProtocolAvailability()
|
||||||
|
|
||||||
dandelion = 0
|
dandelion = 0
|
||||||
|
|
||||||
|
testmode = False
|
||||||
|
|
Reference in New Issue
Block a user