Add enable/disable method in bmconfigparser & initialize kivy state variable inside NavigateApp

This commit is contained in:
shekhar-cis 2022-05-05 15:33:24 +05:30
parent d024deb977
commit 25d58c2a0c
Signed by untrusted user: shekhar-cis
GPG Key ID: F4F00AB04E83F9A7
2 changed files with 10 additions and 1 deletions

View File

@ -211,7 +211,6 @@ class CustomSpinner(Spinner):
class NavigateApp(MDApp):
"""Navigation Layout of class"""
# pylint: disable=too-many-public-methods,inconsistent-return-statements
kivyy = KivyStateVariables()
# theme_cls = ThemeManager()
def __init__(self):
super(NavigateApp, self).__init__()

View File

@ -199,3 +199,13 @@ class BMConfigParser(configparser.ConfigParser):
def search_addresses(address, searched_text):
return [x for x in [BMConfigParser().get(address, 'label').lower(), address.lower()]
if searched_text in x]
def disable_address(self, address):
""""To disable the Address"""
self.set(str(address), 'enabled', 'false')
self.save()
def enable_address(self, address):
""""To enable the Address"""
self.set(address, 'enabled', 'true')
self.save()