Strip trailing newlines from live text
This commit is contained in:
@@ -331,9 +331,9 @@ class AppleLiveText:
|
|||||||
|
|
||||||
process = Popen([self.helper_executable], stdout=PIPE, stdin=PIPE, stderr=PIPE)
|
process = Popen([self.helper_executable], stdout=PIPE, stdin=PIPE, stderr=PIPE)
|
||||||
stdout, stderr = process.communicate(input=self._preprocess(img))
|
stdout, stderr = process.communicate(input=self._preprocess(img))
|
||||||
stdout = stdout.decode()
|
stdout = stdout.decode().rstrip()
|
||||||
if stdout == '':
|
if stdout == '':
|
||||||
return (False, stderr.decode())
|
return (False, stderr.decode().rstrip())
|
||||||
return (True, stdout)
|
return (True, stdout)
|
||||||
|
|
||||||
def _preprocess(self, img):
|
def _preprocess(self, img):
|
||||||
|
|||||||
Reference in New Issue
Block a user