Commit 225fc819 authored by Arnaud Fontaine's avatar Arnaud Fontaine

PortalTransforms: Fix typo in useStdin 'if' condition in subprocesstransform.

useStdin=False => temporary file was not created.
useStdin=True  => temporary file was created.
parent e1d1aa7b
...@@ -148,7 +148,7 @@ class subprocesstransform: ...@@ -148,7 +148,7 @@ class subprocesstransform:
def convert(self, data, cache, **kwargs): def convert(self, data, cache, **kwargs):
command = "%s %s" % (self.binary, self.binaryArgs) command = "%s %s" % (self.binary, self.binaryArgs)
if self.useStdin: if not self.useStdin:
tempfile_object = tempfile.NamedTemporaryFile() tempfile_object = tempfile.NamedTemporaryFile()
tmpname = tempfile_object.name tmpname = tempfile_object.name
tempfile_object.write( data) tempfile_object.write( data)
......
...@@ -23,7 +23,7 @@ class pdf_to_text(subprocesstransform): ...@@ -23,7 +23,7 @@ class pdf_to_text(subprocesstransform):
binaryName = "pdftotext" binaryName = "pdftotext"
binaryArgs = "-enc UTF-8 -layout -nopgbrk %(infile)s -" binaryArgs = "-enc UTF-8 -layout -nopgbrk %(infile)s -"
useStdin = True useStdin = False
class old_pdf_to_text(commandtransform): class old_pdf_to_text(commandtransform):
implements(ITransform) implements(ITransform)
......
...@@ -20,6 +20,7 @@ class tiff_to_text(commandtransform): ...@@ -20,6 +20,7 @@ class tiff_to_text(commandtransform):
binaryName = "tesseract" binaryName = "tesseract"
binaryArgs = "%(infile)s " binaryArgs = "%(infile)s "
useStdin = False
def __init__(self): def __init__(self):
commandtransform.__init__(self, binary=self.binaryName) commandtransform.__init__(self, binary=self.binaryName)
......
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