From 15630ed5a58654be8294261e343b71dfa3d4221f Mon Sep 17 00:00:00 2001 From: shekhar-cis Date: Wed, 4 May 2022 21:09:07 +0530 Subject: [PATCH] Separate search_address backend from kivy --- src/bmconfigparser.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bmconfigparser.py b/src/bmconfigparser.py index a7e1b673..30a6be4b 100644 --- a/src/bmconfigparser.py +++ b/src/bmconfigparser.py @@ -194,3 +194,8 @@ class BMConfigParser(configparser.ConfigParser): if value < 0 or value > 8: return False return True + + @staticmethod + def search_addresses(address, searched_text): + return [x for x in [BMConfigParser().get(address, 'label').lower(), address.lower()] + if searched_text in x]