From 3ff897395f747b23b95bc4b360a91659a92ae3d5 Mon Sep 17 00:00:00 2001 From: shekhar-cis Date: Thu, 30 Jun 2022 19:51:58 +0530 Subject: [PATCH] Update common_backend --- src/common_backend.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/common_backend.py b/src/common_backend.py index a863c122..0c60fc53 100644 --- a/src/common_backend.py +++ b/src/common_backend.py @@ -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,