From 00c4b170189ad73292f81ca9ef7f0954446dc507 Mon Sep 17 00:00:00 2001
From: Patrick Jentsch
Date: Tue, 18 Jan 2022 13:45:17 +0100
Subject: [PATCH] Codestyle update
---
ocr | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/ocr b/ocr
index 5602abe..5e13c5f 100755
--- a/ocr
+++ b/ocr
@@ -385,7 +385,6 @@ class MainWorkflow(WorkflowRunner):
self.input_dir = input_dir
self.lang = lang
self.output_dir = output_dir
- self.output_files = []
self.binarize = binarize
self.jobs = []
@@ -528,33 +527,34 @@ class MainWorkflow(WorkflowRunner):
create_txt_tasks.append(task)
self.waitForTasks()
+ output_files = []
for job in self.jobs:
# Remove temporary directory
os.rmdir(job.tmp_dir)
# Track output files
relative_output_dir = os.path.relpath(job.output_dir, start=self.output_dir) # noqa
- self.output_files.append(
+ output_files.append(
{
'description': 'Post correction package (.png and .hocr).',
'file': os.path.join(relative_output_dir, '{}.poco.zip'.format(job.name)), # noqa
'mimetype': 'application/zip'
}
)
- self.output_files.append(
+ output_files.append(
{
'description': 'PDF file with text layer.',
'file': os.path.join(relative_output_dir, '{}.pdf'.format(job.name)), # noqa
'mimetype': 'application/pdf'
}
)
- self.output_files.append(
+ output_files.append(
{
'description': 'Plain text file.',
'file': os.path.join(relative_output_dir, '{}.txt'.format(job.name)), # noqa
'mimetype': 'text/plain'
}
)
- self.output_files.append(
+ output_files.append(
{
'description': 'TEI compliant XML file.',
'file': os.path.join(relative_output_dir, '{}.tei.xml'.format(job.name)), # noqa
@@ -562,7 +562,7 @@ class MainWorkflow(WorkflowRunner):
}
)
with open(os.path.join(self.output_dir, 'output_records.json'), 'w') as f: # noqa
- json.dump(self.output_files, f, indent=4)
+ json.dump(output_files, f, indent=4)
def parse_args():