mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/ocr.git
synced 2024-12-26 05:24:18 +00:00
Codestyle update
This commit is contained in:
parent
c057d324cf
commit
00c4b17018
12
ocr
12
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():
|
||||
|
Loading…
Reference in New Issue
Block a user