mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/ocr.git
synced 2025-01-12 21:20:34 +00:00
Fix zip creation
This commit is contained in:
parent
36a86887b0
commit
364e3d626d
12
ocr
12
ocr
@ -286,11 +286,15 @@ class OCRPipeline(WorkflowRunner):
|
||||
'''
|
||||
zip_jobs = []
|
||||
if self.zip is not None:
|
||||
# Remove .zip file extension if provided
|
||||
if self.zip.endswith('.zip'):
|
||||
self.zip = self.zip[:-4]
|
||||
self.zip = self.zip if self.zip else 'output'
|
||||
cmd = 'cd "{}"'.format(self.output_dir)
|
||||
cmd += ' && '
|
||||
cmd += 'zip'
|
||||
cmd += ' -r'
|
||||
cmd += ' "{}_-_all" .'.format(self.zip)
|
||||
cmd += ' "{}".zip .'.format(self.zip)
|
||||
cmd += ' -x "pyflow.data*" "*tmp*"'
|
||||
cmd += ' -i "*.pdf" "*.txt" "*.xml"'
|
||||
cmd += ' && '
|
||||
@ -305,7 +309,7 @@ class OCRPipeline(WorkflowRunner):
|
||||
cmd += 'zip'
|
||||
cmd += ' -m'
|
||||
cmd += ' -r'
|
||||
cmd += ' "{}_-_pdf" .'.format(self.zip)
|
||||
cmd += ' "{}".pdf.zip .'.format(self.zip)
|
||||
cmd += ' -x "pyflow.data*" "*tmp*"'
|
||||
cmd += ' -i "*.pdf"'
|
||||
cmd += ' && '
|
||||
@ -320,7 +324,7 @@ class OCRPipeline(WorkflowRunner):
|
||||
cmd += 'zip'
|
||||
cmd += ' -m'
|
||||
cmd += ' -r'
|
||||
cmd += ' "{}_-_txt" .'.format(self.zip)
|
||||
cmd += ' "{}".txt.zip .'.format(self.zip)
|
||||
cmd += ' -x "pyflow.data*" "*tmp*"'
|
||||
cmd += ' -i "*.txt"'
|
||||
cmd += ' && '
|
||||
@ -335,7 +339,7 @@ class OCRPipeline(WorkflowRunner):
|
||||
cmd += 'zip'
|
||||
cmd += ' -m'
|
||||
cmd += ' -r'
|
||||
cmd += ' "{}_-_xml" .'.format(self.zip)
|
||||
cmd += ' "{}".xml.zip .'.format(self.zip)
|
||||
cmd += ' -x "pyflow.data*" "*tmp*"'
|
||||
cmd += ' -i "*.xml"'
|
||||
cmd += ' && '
|
||||
|
Loading…
x
Reference in New Issue
Block a user