Update and re-enable ocr app
This commit is contained in:
@@ -2,60 +2,52 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from smart_settings import LocalScope
|
||||
from smart_settings import LocalScope, ClusterScope
|
||||
|
||||
from .icons import icon_submit_document
|
||||
from .literals import (DEFAULT_TESSERACT_PATH, DEFAULT_TESSERACT_LANGUAGE,
|
||||
DEFAULT_REPLICATION_DELAY, DEFAULT_UNPAPER_PATH, DEFAULT_PDFTOTEXT_PATH)
|
||||
from .links import all_document_ocr_cleanup
|
||||
|
||||
label = _(u'OCR')
|
||||
description = _(u'Handles optical character recognition.')
|
||||
icon = icon_submit_document
|
||||
dependencies = ['app_registry', 'icons', 'navigation']
|
||||
#maintenance_links = [all_document_ocr_cleanup]
|
||||
settings = [
|
||||
{
|
||||
'name': 'AUTOMATIC_OCR',
|
||||
'default': True,
|
||||
'description': _(u'Automatically queue newly created documents for OCR.'),
|
||||
'scopes': [ClusterScope()]
|
||||
},
|
||||
{
|
||||
'name': 'TESSERACT_PATH',
|
||||
'default': u'/usr/bin/tesseract',
|
||||
'default': DEFAULT_TESSERACT_PATH,
|
||||
'exists': True,
|
||||
'scopes': [LocalScope()]
|
||||
},
|
||||
{
|
||||
'name': 'TESSERACT_LANGUAGE',
|
||||
'default': u'eng',
|
||||
'scopes': [LocalScope()]
|
||||
'default': DEFAULT_TESSERACT_LANGUAGE,
|
||||
'scopes': [ClusterScope()]
|
||||
},
|
||||
{
|
||||
'name': 'REPLICATION_DELAY',
|
||||
'default': 0,
|
||||
'default': DEFAULT_REPLICATION_DELAY,
|
||||
'description': _(u'Amount of seconds to delay OCR of documents to allow for the node\'s storage replication overhead.'),
|
||||
'scopes': [LocalScope()]
|
||||
},
|
||||
{
|
||||
'name': 'NODE_CONCURRENT_EXECUTION',
|
||||
'default': 1,
|
||||
'description': _(u'Maximum amount of concurrent document OCRs a node can perform.'),
|
||||
'scopes': [LocalScope()]
|
||||
},
|
||||
{
|
||||
'name': 'AUTOMATIC_OCR',
|
||||
'default': True,
|
||||
'description': _(u'Automatically queue newly created documents for OCR.'),
|
||||
'scopes': [LocalScope()]
|
||||
},
|
||||
{
|
||||
'name': 'QUEUE_PROCESSING_INTERVAL',
|
||||
'default': 10,
|
||||
'description': _(u'Automatically queue newly created documents for OCR.'),
|
||||
'scopes': [LocalScope()]
|
||||
},
|
||||
{
|
||||
'name': 'UNPAPER_PATH',
|
||||
'default': u'/usr/bin/unpaper',
|
||||
'default': DEFAULT_UNPAPER_PATH,
|
||||
'description': _(u'File path to unpaper program.'),
|
||||
'exists': True,
|
||||
'scopes': [LocalScope()]
|
||||
},
|
||||
{
|
||||
'name': 'PDFTOTEXT_PATH',
|
||||
'default': u'/usr/bin/pdftotext',
|
||||
'default': DEFAULT_PDFTOTEXT_PATH,
|
||||
'description': _(u'File path to poppler\'s pdftotext program used to extract text from PDF files.'),
|
||||
'exists': True,
|
||||
'scopes': [LocalScope()]
|
||||
|
||||
Reference in New Issue
Block a user