Fix suppression of tesseract config error messages

This commit is contained in:
James R. Barlow
2018-10-03 17:39:50 -07:00
parent baddd6d233
commit fb8b161f6c
2 changed files with 13 additions and 9 deletions
+4 -3
View File
@@ -190,13 +190,14 @@ def tesseract_log_output(log, stdout, input_file):
pass # Appears to be spurious/problem with nonwhite borders
elif 'Error in boxClipToRectangle' in line:
pass # Always appears with pixScanForForeground message
elif 'parameter not found: ' in line.lower():
log.error(prefix + line.strip())
problem = line.split('found: ')[1]
raise TesseractConfigError(problem)
elif 'error' in line.lower() or 'exception' in line.lower():
log.error(prefix + line.strip())
elif 'warning' in line.lower():
log.warning(prefix + line.strip())
elif 'parameter not found: ' in line.lower():
problem = line.split('found: ')[1]
raise TesseractConfigError(problem)
elif 'read_params_file' in line.lower():
log.error(prefix + line.strip())
else: