Don't process files in subdirectories

This commit is contained in:
Patrick Jentsch 2021-04-12 13:22:28 +02:00
parent a798457c43
commit a0760487ae

5
ocr
View File

@ -289,9 +289,8 @@ def collect_jobs(input_dir, output_dir):
jobs = [] jobs = []
for file in os.listdir(input_dir): for file in os.listdir(input_dir):
if os.path.isdir(os.path.join(input_dir, file)): if os.path.isdir(os.path.join(input_dir, file)):
jobs += collect_jobs(os.path.join(input_dir, file), continue
os.path.join(output_dir, file)) if file.lower().endswith('.pdf'):
elif file.lower().endswith('.pdf'):
job = OCRPipelineJob(os.path.join(input_dir, file), job = OCRPipelineJob(os.path.join(input_dir, file),
os.path.join(output_dir, file)) os.path.join(output_dir, file))
jobs.append(job) jobs.append(job)