diff --git a/src/ifk_scb_compilations/search_scb.py b/src/ifk_scb_compilations/search_scb.py index 2b24a68..4623cd9 100644 --- a/src/ifk_scb_compilations/search_scb.py +++ b/src/ifk_scb_compilations/search_scb.py @@ -65,12 +65,11 @@ def recursive_search(nodes: list) -> None: return results - def search_substring(self, substring: str): + def search_substring(self, *arg: str): """Search for substring in scb db. Args: - substring: String to search for - entry_ids: a list of list with entry ids + arg: Strings to search for Returns: list: elements are tuple with search path and title containing substring @@ -78,7 +77,7 @@ def search_substring(self, substring: str): with open(self.search_tree_file_path, "rt") as f: print(f.readline()) for line in f: - if substring in line: + if all(s.lower() in line.lower() for s in arg): print(line) pass @@ -87,4 +86,4 @@ def search_substring(self, substring: str): if __name__ == "__main__": sSearch = ScbSearch() # sSearch.update_search_tree() - sSearch.search_substring("region") + sSearch.search_substring("region", "luft")