Do not fail, when ocr backend is missing (#50).

- Since tesseract (i.e. an ocr backend) is an optional requiremnt of mayan, we
  shouldn't fail, if it is not found.
- S.a https://github.com/mayan-edms/mayan-edms/issues/50
This commit is contained in:
Mathias Behrle
2014-09-25 19:31:46 +02:00
parent 389143a8b7
commit 034875a88a

View File

@@ -73,6 +73,9 @@ def do_document_ocr(queue_document):
document_page.content = ocr_cleanup(ocr_text)
document_page.page_label = _(u'Text from OCR')
document_page.save()
except Exception as e:
logger.debug('missing ocr backend: %s' % ocr_backend)
logger.debug('I/O error({0}): {1}'.format(e.errno, e.strerror))
finally:
fs_cleanup(pre_ocr_filepath_w_ext)
fs_cleanup(unpaper_input)