Commit 70914e3e authored by Gabriel Monnerat's avatar Gabriel Monnerat

refactor code to use File API

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@43639 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9073faf1
...@@ -54,8 +54,9 @@ class ImageMagickHandler(object): ...@@ -54,8 +54,9 @@ class ImageMagickHandler(object):
stdout=PIPE, stdout=PIPE,
stderr=PIPE, stderr=PIPE,
env=self.environment).communicate() env=self.environment).communicate()
self.document.reload(output_url)
try: try:
return open(output_url).read() return self.document.getContent()
finally: finally:
self.document.trash() self.document.trash()
......
...@@ -53,8 +53,9 @@ class PDFHandler(object): ...@@ -53,8 +53,9 @@ class PDFHandler(object):
stdout=PIPE, stdout=PIPE,
stderr=PIPE, stderr=PIPE,
env=self.environment).communicate() env=self.environment).communicate()
self.document.reload(output_url)
try: try:
return open(output_url).read() return self.document.getContent()
finally: finally:
self.document.trash() self.document.trash()
...@@ -104,7 +105,8 @@ class PDFHandler(object): ...@@ -104,7 +105,8 @@ class PDFHandler(object):
stdout=PIPE, stdout=PIPE,
stderr=PIPE, stderr=PIPE,
env=self.environment).communicate() env=self.environment).communicate()
self.document.reload(output_url)
try: try:
return open(output_url).read() return self.document.getContent()
finally: finally:
self.document.trash() self.document.trash()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment