From a0760487ae579f7ec16931c4422728a3e2d997ee Mon Sep 17 00:00:00 2001
From: Patrick Jentsch
Date: Mon, 12 Apr 2021 13:22:28 +0200
Subject: [PATCH] Don't process files in subdirectories
---
ocr | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/ocr b/ocr
index e15967a..09e2140 100755
--- a/ocr
+++ b/ocr
@@ -289,9 +289,8 @@ def collect_jobs(input_dir, output_dir):
jobs = []
for file in os.listdir(input_dir):
if os.path.isdir(os.path.join(input_dir, file)):
- jobs += collect_jobs(os.path.join(input_dir, file),
- os.path.join(output_dir, file))
- elif file.lower().endswith('.pdf'):
+ continue
+ if file.lower().endswith('.pdf'):
job = OCRPipelineJob(os.path.join(input_dir, file),
os.path.join(output_dir, file))
jobs.append(job)