Convert all apps to use the new class based settings

This commit is contained in:
Roberto Rosario
2012-03-06 16:08:28 -04:00
parent 11a9d87701
commit c9dcda3a5c
15 changed files with 476 additions and 203 deletions

View File

@@ -2,18 +2,62 @@
from django.utils.translation import ugettext_lazy as _
from smart_settings.api import register_settings
from smart_settings.api import Setting, SettingNamespace
register_settings(
namespace=u'ocr',
module=u'ocr.conf.settings',
settings=[
{'name': u'TESSERACT_PATH', 'global_name': u'OCR_TESSERACT_PATH', 'default': u'/usr/bin/tesseract', 'exists': True},
{'name': u'TESSERACT_LANGUAGE', 'global_name': u'OCR_TESSERACT_LANGUAGE', 'default': u'eng'},
{'name': u'REPLICATION_DELAY', 'global_name': u'OCR_REPLICATION_DELAY', 'default': 0, 'description': _(u'Amount of seconds to delay OCR of documents to allow for the node\'s storage replication overhead.')},
{'name': u'NODE_CONCURRENT_EXECUTION', 'global_name': u'OCR_NODE_CONCURRENT_EXECUTION', 'default': 1, 'description': _(u'Maximum amount of concurrent document OCRs a node can perform.')},
{'name': u'AUTOMATIC_OCR', 'global_name': u'OCR_AUTOMATIC_OCR', 'default': False, 'description': _(u'Automatically queue newly created documents for OCR.')},
{'name': u'QUEUE_PROCESSING_INTERVAL', 'global_name': u'OCR_QUEUE_PROCESSING_INTERVAL', 'default': 10},
{'name': u'UNPAPER_PATH', 'global_name': u'OCR_UNPAPER_PATH', 'default': u'/usr/bin/unpaper', 'description': _(u'File path to unpaper program.'), 'exists': True},
]
namespace = SettingNamespace('ocr', _(u'OCR'), module='ocr.conf.settings')
Setting(
namespace=namespace,
name='TESSERACT_PATH',
global_name='OCR_TESSERACT_PATH',
default=u'/usr/bin/tesseract',
exists=True,
)
Setting(
namespace=namespace,
name='TESSERACT_LANGUAGE',
global_name='OCR_TESSERACT_LANGUAGE',
default=u'eng',
)
Setting(
namespace=namespace,
name='REPLICATION_DELAY',
global_name='OCR_REPLICATION_DELAY',
default=0,
description=_(u'Amount of seconds to delay OCR of documents to allow for the node\'s storage replication overhead.'),
)
Setting(
namespace=namespace,
name='NODE_CONCURRENT_EXECUTION',
global_name='OCR_NODE_CONCURRENT_EXECUTION',
default=1,
description=_(u'Maximum amount of concurrent document OCRs a node can perform.')
)
Setting(
namespace=namespace,
name='AUTOMATIC_OCR',
global_name='OCR_AUTOMATIC_OCR',
default=False,
description=_(u'Automatically queue newly created documents for OCR.')
)
Setting(
namespace=namespace,
name='QUEUE_PROCESSING_INTERVAL',
global_name='OCR_QUEUE_PROCESSING_INTERVAL',
default=10,
description=_(u'Automatically queue newly created documents for OCR.')
)
Setting(
namespace=namespace,
name='UNPAPER_PATH',
global_name='OCR_UNPAPER_PATH',
default=u'/usr/bin/unpaper',
description=_(u'File path to unpaper program.'),
exists=True
)