From 337c186865dc5d130216b17df461268593c3cb3d Mon Sep 17 00:00:00 2001 From: shekhar-cis Date: Wed, 4 May 2022 21:07:35 +0530 Subject: [PATCH] Add identity enable/disable function in addresses.py --- src/addresses.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/addresses.py b/src/addresses.py index c3c61466..192c819f 100644 --- a/src/addresses.py +++ b/src/addresses.py @@ -8,6 +8,8 @@ from struct import pack, unpack from debug import logger +from bmconfigparser import BMConfigParser + ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" @@ -276,3 +278,15 @@ def addBMIfNotPresent(address): """Prepend BM- to an address if it doesn't already have it""" address = str(address).strip() return address if address[:3] == 'BM-' else 'BM-' + address + + +def disable_addresses(address): + """"To disable the Address""" + BMConfigParser().set(str(address), 'enabled', 'false') + BMConfigParser().save() + + +def enable_addresses(address): + """"To enable the Address""" + BMConfigParser().set(address, 'enabled', 'true') + BMConfigParser().save()