Skip to content

Commit

Permalink
types
Browse files Browse the repository at this point in the history
  • Loading branch information
strobba committed Feb 10, 2024
1 parent 7aedc22 commit 72bcc3a
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/ifk_scb_compilations/search_scb.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __init__(self):
self.log_file_path = "log/update_search_tree.log"
self.sleep_time = 0.7

def update_search_tree(self, entry_ids: list = None) -> list:
def update_search_tree(self) -> list:
"""Generate scb search tree.
Args:
Expand All @@ -28,7 +28,7 @@ def update_search_tree(self, entry_ids: list = None) -> list:
with open(self.search_tree_file_path, "w") as f:
f.write(f"updated {datetime.today()}\n")
scb = SCB("sv")
results = []
results: list[tuple] = []

def recursive_search(nodes: list) -> None:
"""Recursively dig in search tree.
Expand Down Expand Up @@ -60,16 +60,13 @@ def recursive_search(nodes: list) -> None:
else:
logging.warning(f"{nodes} not list or dict.")

if not entry_ids: # use all ids
for entry in scb.info():
recursive_search([entry["id"]])
else:
for entry in entry_ids:
recursive_search(entry)

for entry in scb.info():
recursive_search([entry["id"]])

return results

def search_substring(self, substring: str) -> list:
def search_substring(self, substring: str):
"""Search for substring in scb db.
Args:
Expand Down

0 comments on commit 72bcc3a

Please sign in to comment.