Revert "icat: Use scandir for slightly better performance"
This reverts commit 2e893690bd288108baff210f710a0d415b030c1c. scandir is not recursive
This commit is contained in:
parent
9e9d1a4e96
commit
8e5175e56b
@ -359,11 +359,11 @@ def process(path: str, args: IcatCLIOptions, parsed_opts: ParsedOpts, is_tempfil
|
|||||||
|
|
||||||
|
|
||||||
def scan(d: str) -> Generator[Tuple[str, str], None, None]:
|
def scan(d: str) -> Generator[Tuple[str, str], None, None]:
|
||||||
for entry in os.scandir(d):
|
for dirpath, dirnames, filenames in os.walk(d):
|
||||||
if entry.is_file():
|
for f in filenames:
|
||||||
mt = guess_type(entry.name)
|
mt = guess_type(f)
|
||||||
if mt and mt.startswith('image/'):
|
if mt and mt.startswith('image/'):
|
||||||
yield entry.path, mt
|
yield os.path.join(dirpath, f), mt
|
||||||
|
|
||||||
|
|
||||||
def detect_support(wait_for: float = 10, silent: bool = False) -> bool:
|
def detect_support(wait_for: float = 10, silent: bool = False) -> bool:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user