aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodney Ewing <ewing.rj@gmail.com>2013-08-14 10:58:31 -0700
committerRodney Ewing <ewing.rj@gmail.com>2013-08-16 15:30:21 -0700
commite7672e5b48687f75c08c360ee86f71ec43566512 (patch)
treee5c2f55367be305d967292b00b4d117669043424
parent61b3fc5078751523adeb4b8b5920667dd65ca356 (diff)
downloadmediagoblin-e7672e5b48687f75c08c360ee86f71ec43566512.tar.lz
mediagoblin-e7672e5b48687f75c08c360ee86f71ec43566512.tar.xz
mediagoblin-e7672e5b48687f75c08c360ee86f71ec43566512.zip
use a tmp_pdf filename
-rw-r--r--mediagoblin/media_types/pdf/processing.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mediagoblin/media_types/pdf/processing.py b/mediagoblin/media_types/pdf/processing.py
index 8294fbe2..17a3246c 100644
--- a/mediagoblin/media_types/pdf/processing.py
+++ b/mediagoblin/media_types/pdf/processing.py
@@ -288,15 +288,17 @@ class CommonPdfProcessor(MediaProcessor):
"""
Store the pdf. If the file is not a pdf, make it a pdf
"""
+ tmp_pdf = self.orig_filename
+
unoconv = where('unoconv')
Popen(executable=unoconv,
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')
raise BadMediaFail()
- store_public(self.entry, 'pdf', self.pdf_filename,
+ store_public(self.entry, 'pdf', tmp_pdf,
self.name_builder.fill('{basename}.pdf'))
return self.workbench.local_file(