Update common_backend

This commit is contained in:
shekhar-cis 2022-06-30 19:51:58 +05:30
parent 60d69e5314
commit 3ff897395f
Signed by untrusted user: shekhar-cis
GPG Key ID: F4F00AB04E83F9A7

View File

@ -1,21 +1,22 @@
"""
Common methods and functions for kivy and qt.
"""
import queues
from bmconfigparser import BMConfigParser
from bitmessagekivy.baseclass.common import toast
class AddressGenerator:
@staticmethod
def generate_address(entered_label):
""""Return True if the label is uniqe"""
streamNumberForAddress = 1
eighteenByteRipe = False
nonceTrialsPerByte = 1000
payloadLengthExtraBytes = 1000
def start_address_generation(
entered_label, streamNumberForAddress=1, eighteenByteRipe=False,
nonceTrialsPerByte=1000, payloadLengthExtraBytes=1000
):
""""Return True if the label is unique"""
labels = [BMConfigParser().get(obj, 'label')
for obj in BMConfigParser().addresses()]
if entered_label and entered_label not in labels:
toast('Address Creating...')
queues.addressGeneratorQueue.put((
'createRandomAddress', 4, streamNumberForAddress, entered_label, 1,
"", eighteenByteRipe, nonceTrialsPerByte,