From 034875a88af16c4543e5c0a6d561b941f18a2f15 Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Thu, 25 Sep 2014 19:31:46 +0200 Subject: [PATCH] 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 --- mayan/apps/ocr/api.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mayan/apps/ocr/api.py b/mayan/apps/ocr/api.py index 67e74727bf..261cac66a8 100644 --- a/mayan/apps/ocr/api.py +++ b/mayan/apps/ocr/api.py @@ -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)