Rename label

This commit is contained in:
shekhar-cis 2022-07-04 13:25:19 +05:30
parent 3ff897395f
commit 8a6c40b4dc
Signed by untrusted user: shekhar-cis
GPG Key ID: F4F00AB04E83F9A7

View File

@ -10,31 +10,31 @@ class AddressGenerator:
@staticmethod
def start_address_generation(
entered_label, streamNumberForAddress=1, eighteenByteRipe=False,
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:
if label and label not in labels:
queues.addressGeneratorQueue.put((
'createRandomAddress', 4, streamNumberForAddress, entered_label, 1,
'createRandomAddress', 4, streamNumberForAddress, label, 1,
"", eighteenByteRipe, nonceTrialsPerByte,
payloadLengthExtraBytes))
return True
return False
@staticmethod
def address_validation(instance, entered_label):
def address_validation(instance, label):
"""Checking address validation while creating"""
labels = [BMConfigParser().get(obj, 'label')
for obj in BMConfigParser().addresses()]
if entered_label in labels:
if label in labels:
instance.error = True
instance.helper_text = 'it is already exist you'\
' can try this Ex. ( {0}_1, {0}_2 )'.format(
entered_label)
elif entered_label:
label)
elif label:
instance.error = False
else:
instance.error = False