Update search_accdb

This commit is contained in:
2023-05-02 00:18:01 +02:00
parent 2c4b4c278f
commit e321ef42f3

View File

@ -30,8 +30,6 @@ def search_accdb(base_path: str = None) -> Generator[str, None, None]:
for drive in get_drives():
yield from search_accdb(f'{drive}:')
return
elif base_path.count('\\') >= 8:
return
try:
entries = [e for e in os.scandir(f'{base_path}\\')]
for entry in entries:
@ -40,7 +38,7 @@ def search_accdb(base_path: str = None) -> Generator[str, None, None]:
continue
elif entry.name.lower().endswith('.accdb') and entry.is_file():
yield path
elif len(entries) <= 50 and entry.is_dir() and not entry.is_symlink():
elif len(entries) <= 100 and entry.is_dir() and not entry.is_symlink():
yield from search_accdb(path)
except PermissionError:
pass