remove qt dependency
This commit is contained in:
parent
16e9319d5f
commit
14a4f42fc0
|
@ -3,21 +3,18 @@ Create random address
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import defaults
|
import defaults
|
||||||
import queues
|
import queues
|
||||||
import state
|
import state
|
||||||
|
|
||||||
from bitmessageqt import account
|
|
||||||
from bitmessageqt.foldertree import AccountMixin
|
|
||||||
from bmconfigparser import BMConfigParser
|
from bmconfigparser import BMConfigParser
|
||||||
|
|
||||||
|
|
||||||
def checkHasNormalAddress():
|
def checkHasNormalAddress():
|
||||||
"""method for checking address"""
|
"""method for checking address"""
|
||||||
for address in account.getSortedAccounts():
|
for address in BMConfigParser().addresses():
|
||||||
acct = account.accountClass(address)
|
|
||||||
if acct.type == AccountMixin.NORMAL and BMConfigParser().safeGetBoolean(address, 'enabled'):
|
if BMConfigParser().safeGetBoolean(address, 'enabled'):
|
||||||
return address
|
return address
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -32,6 +29,9 @@ def createAddressIfNeeded(label_text, streamNumberForAddress=1):
|
||||||
defaults.networkDefaultProofOfWorkNonceTrialsPerByte,
|
defaults.networkDefaultProofOfWorkNonceTrialsPerByte,
|
||||||
defaults.networkDefaultPayloadLengthExtraBytes
|
defaults.networkDefaultPayloadLengthExtraBytes
|
||||||
))
|
))
|
||||||
|
start_time = time.time()
|
||||||
while state.shutdown == 0 and not checkHasNormalAddress():
|
while state.shutdown == 0 and not checkHasNormalAddress():
|
||||||
time.sleep(.2)
|
time.sleep(.2)
|
||||||
|
if int(time.time() - start_time) > 8:
|
||||||
|
break
|
||||||
return checkHasNormalAddress()
|
return checkHasNormalAddress()
|
||||||
|
|
Reference in New Issue
Block a user