use a tmp_pdf filename

This commit is contained in:
Rodney Ewing 2013-08-14 10:58:31 -07:00
parent 61b3fc5078
commit e7672e5b48

View File

@ -288,15 +288,17 @@ class CommonPdfProcessor(MediaProcessor):
""" """
Store the pdf. If the file is not a pdf, make it a pdf Store the pdf. If the file is not a pdf, make it a pdf
""" """
tmp_pdf = self.orig_filename
unoconv = where('unoconv') unoconv = where('unoconv')
Popen(executable=unoconv, Popen(executable=unoconv,
args=[unoconv, '-v', '-f', 'pdf', self.orig_filename]).wait() args=[unoconv, '-v', '-f', 'pdf', self.orig_filename]).wait()
if not os.path.exists(self.pdf_filename): if not os.path.exists(tmp_pdf):
_log.debug('unoconv failed to convert file to pdf') _log.debug('unoconv failed to convert file to pdf')
raise BadMediaFail() raise BadMediaFail()
store_public(self.entry, 'pdf', self.pdf_filename, store_public(self.entry, 'pdf', tmp_pdf,
self.name_builder.fill('{basename}.pdf')) self.name_builder.fill('{basename}.pdf'))
return self.workbench.local_file( return self.workbench.local_file(