Example #1
0
from __future__ import unicode_literals

import os

from django.conf import settings
from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='storage', label=_('Storage'))
setting_filestorage_location = namespace.add_setting(
    global_name='STORAGE_FILESTORAGE_LOCATION',
    default=os.path.join(settings.MEDIA_ROOT, 'document_storage'), is_path=True
)
Example #2
0
from __future__ import unicode_literals

import tempfile

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='common', label=_('Common'))
setting_auto_logging = namespace.add_setting(
    global_name='COMMON_AUTO_LOGGING',
    default=True,
    help_text=_('Automatically enable logging to all apps.')
)
settings_db_sync_task_delay = namespace.add_setting(
    global_name='COMMON_DB_SYNC_TASK_DELAY',
    default=2,
    help_text=_(
        'Time to delay background tasks that depend on a database commit to '
        'propagate.'
    )
)
setting_paginate_by = namespace.add_setting(
    global_name='COMMON_PAGINATE_BY',
    default=40,
    help_text=_(
        'An integer specifying how many objects should be displayed per page.'
    )
)
setting_shared_storage = namespace.add_setting(
    global_name='COMMON_SHARED_STORAGE',
Example #3
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='mirroring', label=_('Mirroring'))

setting_document_lookup_cache_timeout = namespace.add_setting(
    global_name='MIRRORING_DOCUMENT_CACHE_LOOKUP_TIMEOUT', default=10,
    help_text=_('Time in seconds to cache the path lookup to a document.'),
)
setting_node_lookup_cache_timeout = namespace.add_setting(
    global_name='MIRRORING_NODE_CACHE_LOOKUP_TIMEOUT', default=10,
    help_text=_('Time in seconds to cache the path lookup to an index node.'),
)
Example #4
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='signatures', label=_('Document signatures'))
setting_storage_backend = namespace.add_setting(
    global_name='SIGNATURES_STORAGE_BACKEND',
    default='storage.backends.filebasedstorage.FileBasedStorage'
)
Example #5
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

from .literals import (
    DEFAULT_DOCUMENT_BODY_TEMPLATE, DEFAULT_LINK_BODY_TEMPLATE
)

namespace = Namespace(name='mailer', label=_('Mailing'))

setting_link_subject_template = namespace.add_setting(
    default=_('Link for document: {{ document }}'),
    help_text=_('Template for the document link email form subject line.'),
    global_name='MAILER_LINK_SUBJECT_TEMPLATE', quoted=True
)
setting_link_body_template = namespace.add_setting(
    default=DEFAULT_LINK_BODY_TEMPLATE,
    help_text=_('Template for the document link email form body text. Can include HTML.'),
    global_name='MAILER_LINK_BODY_TEMPLATE', quoted=True
)
setting_document_subject_template = namespace.add_setting(
    default=_('Document: {{ document }}'),
    help_text=_('Template for the document email form subject line.'),
    global_name='MAILER_DOCUMENT_SUBJECT_TEMPLATE', quoted=True
)
setting_document_body_template = namespace.add_setting(
    default=DEFAULT_DOCUMENT_BODY_TEMPLATE,
    help_text=_('Template for the document email form body text. Can include HTML.'),
    global_name='MAILER_DOCUMENT_BODY_TEMPLATE', quoted=True
Example #6
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

DEFAULT_BACKEND = 'lock_manager.backends.file_lock.FileLock'
DEFAULT_LOCK_TIMEOUT_VALUE = 30

namespace = Namespace(name='lock_manager', label=_('Lock manager'))

setting_backend = namespace.add_setting(
    default=DEFAULT_BACKEND,
    global_name='LOCK_MANAGER_BACKEND', help_text=_(
        'Path to the class to use when to request and release '
        'resource locks.'
    )
)

setting_default_lock_timeout = namespace.add_setting(
    default=DEFAULT_LOCK_TIMEOUT_VALUE,
    global_name='LOCK_MANAGER_DEFAULT_LOCK_TIMEOUT', help_text=_(
        'Default amount of time in seconds after which a resource '
        'lock will be automatically released.'
    )
)
Example #7
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

from .parsers import MetadataParser
from .validators import MetadataValidator

namespace = Namespace(name='metadata', label=_('Metadata'))
setting_available_validators = namespace.add_setting(
    global_name='METADATA_AVAILABLE_VALIDATORS',
    default=MetadataValidator.get_import_paths())
setting_available_parsers = namespace.add_setting(
    global_name='METADATA_AVAILABLE_PARSERS',
    default=MetadataParser.get_import_paths())
Example #8
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

from .literals import DEFAULT_MAXIMUM_TITLE_LENGTH

namespace = Namespace(name='appearance', label=_('Appearance'))
setting_max_title_length = namespace.add_setting(
    global_name='APPEARANCE_MAXIMUM_TITLE_LENGTH',
    default=DEFAULT_MAXIMUM_TITLE_LENGTH
)
Example #9
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='sources', label=_('Sources'))

setting_scanimage_path = namespace.add_setting(
    global_name='SOURCE_SCANIMAGE_PATH', default='/usr/bin/scanimage',
    help_text=_(
        'File path to the scanimage program used to control image scanners.'
    ),
    is_path=True
)
Example #10
0
"""
This module should be called settings.py but is named conf.py to avoid a
class with the mayan/settings/* module
"""

from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='mayan', label=_('Mayan'))

setting_celery_class = namespace.add_setting(
    help_text=_('The class used to instanciate the main Celery app.'),
    global_name='MAYAN_CELERY_CLASS',
    default='celery.Celery'
)
Example #11
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

from .literals import DEFAULT_LOGIN_METHOD, DEFAULT_MAXIMUM_SESSION_LENGTH

namespace = Namespace(name='authentication', label=_('Authentication'))
setting_login_method = namespace.add_setting(
    global_name='AUTHENTICATION_LOGIN_METHOD',
    default=DEFAULT_LOGIN_METHOD,
    help_text=_(
        'Controls the mechanism used to authenticated user. Options are: '
        'username, email'))
setting_maximum_session_length = namespace.add_setting(
    global_name='AUTHENTICATION_MAXIMUM_SESSION_LENGTH',
    default=DEFAULT_MAXIMUM_SESSION_LENGTH,
    help_text=_(
        'Maximum time an user clicking the "Remember me" checkbox will '
        'remain logged in. Value is time in seconds.'))
Example #12
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

from .literals import (
    DEFAULT_LIBREOFFICE_PATH, DEFAULT_PDFTOPPM_DPI, DEFAULT_PDFTOPPM_FORMAT,
    DEFAULT_PDFTOPPM_PATH, DEFAULT_PDFINFO_PATH, DEFAULT_PILLOW_FORMAT
)

namespace = Namespace(name='converter', label=_('Converter'))
setting_graphics_backend = namespace.add_setting(
    default='converter.backends.python.Python',
    help_text=_('Graphics conversion backend to use.'),
    global_name='CONVERTER_GRAPHICS_BACKEND',
)
setting_graphics_backend_config = namespace.add_setting(
    default='''
        {{
            libreoffice_path: {},
            pdftoppm_dpi: {},
            pdftoppm_format: {},
            pdftoppm_path: {},
            pdfinfo_path: {},
            pillow_format: {}

        }}
    '''.replace('\n', '').format(
        DEFAULT_LIBREOFFICE_PATH, DEFAULT_PDFTOPPM_DPI,
        DEFAULT_PDFTOPPM_FORMAT, DEFAULT_PDFTOPPM_PATH, DEFAULT_PDFINFO_PATH,
Example #13
0
from __future__ import unicode_literals

import os
import tempfile

from django.conf import settings
from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='common', label=_('Common'))
setting_auto_logging = namespace.add_setting(
    global_name='COMMON_AUTO_LOGGING',
    default=True,
    help_text=_('Automatically enable logging to all apps.')
)
settings_db_sync_task_delay = namespace.add_setting(
    global_name='COMMON_DB_SYNC_TASK_DELAY',
    default=2,
    help_text=_(
        'Time to delay background tasks that depend on a database commit to '
        'propagate.'
    )
)
setting_local_settings_filename = namespace.add_setting(
    global_name='COMMON_LOCAL_SETTINGS_FILENAME',
    default='local', help_text=_(
        'Filename of the local settings file (just the filename, extension '
        'will be .py).'
    )
)
Example #14
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='sources', label=_('Sources'))

setting_scanimage_path = namespace.add_setting(
    global_name='SOURCE_SCANIMAGE_PATH',
    default='/usr/bin/scanimage',
    help_text=_(
        'File path to the scanimage program used to control image scanners.'),
    is_path=True)
Example #15
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

from .literals import DEFAULT_MAXIMUM_TITLE_LENGTH

namespace = Namespace(name='appearance', label=_('Appearance'))
setting_max_title_length = namespace.add_setting(
    global_name='APPEARANCE_MAXIMUM_TITLE_LENGTH',
    default=DEFAULT_MAXIMUM_TITLE_LENGTH)
Example #16
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='authentication', label=_('Authentication'))
setting_login_method = namespace.add_setting(
    global_name='AUTHENTICATION_LOGIN_METHOD',
    default='username',
    help_text=_(
        'Controls the mechanism used to authenticated user. Options are: '
        'username, email'))
Example #17
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(label=_('MIME type'), name='mimetype')

setting_file_read_size = namespace.add_setting(
    default=0, global_name='MIMETYPE_FILE_READ_SIZE', help_text=_(
        'Amount of bytes to read from a document to determine its MIME type. '
        'Setting it to 0 disables the feature and attempts to read the entire '
        'document file into memory.'
    )
)
Example #18
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

DEFAULT_BACKEND = 'lock_manager.backends.file_lock.FileLock'
DEFAULT_LOCK_TIMEOUT_VALUE = 30

namespace = Namespace(name='lock_manager', label=_('Lock manager'))

setting_backend = namespace.add_setting(
    default=DEFAULT_BACKEND,
    global_name='LOCK_MANAGER_DEFAULT_BACKEND',
)

setting_default_lock_timeout = namespace.add_setting(
    default=DEFAULT_LOCK_TIMEOUT_VALUE,
    global_name='LOCK_MANAGER_DEFAULT_LOCK_TIMEOUT',
)
Example #19
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='ocr', label=_('OCR'))

setting_ocr_backend = namespace.add_setting(
    global_name='OCR_BACKEND', default='ocr.backends.pyocr.PyOCR',
    help_text=_('Full path to the backend to be used to do OCR.')
)
setting_ocr_backend_arguments = namespace.add_setting(
    global_name='OCR_BACKEND_ARGUMENTS',
    default=''
)
setting_auto_ocr = namespace.add_setting(
    global_name='OCR_AUTO_OCR', default=True,
    help_text=_(
        'Set new document types to perform OCR automatically by default.'
    )
)
Example #20
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='document_parsing', label=_('Document parsing'))

setting_pdftotext_path = namespace.add_setting(
    global_name='DOCUMENT_PARSING_PDFTOTEXT_PATH',
    default='/usr/bin/pdftotext',
    help_text=_(
        'File path to poppler\'s pdftotext program used to extract text '
        'from PDF files.'),
    is_path=True)
Example #21
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace


namespace = Namespace(name='dynamic_search', label=_('Search'))
setting_limit = namespace.add_setting(
    global_name='SEARCH_LIMIT', default=100,
    help_text=_('Maximum amount search hits to fetch and display.')
)
Example #22
0
from __future__ import unicode_literals

import os

from django.conf import settings
from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='django_gpg', label=_('Signatures'))
setting_keyservers = namespace.add_setting(
    global_name='SIGNATURES_KEYSERVERS', default=['pool.sks-keyservers.net'],
    help_text=_('List of keyservers to be queried for unknown keys.')
)
setting_gpg_home = namespace.add_setting(
    global_name='SIGNATURES_GPG_HOME',
    default=os.path.join(settings.MEDIA_ROOT, 'gpg_home'),
    help_text=_(
        'Home directory used to store keys as well as configuration files.'
    ),
    is_path=True
)
setting_gpg_path = namespace.add_setting(
    global_name='SIGNATURES_GPG_PATH', default='/usr/bin/gpg',
    help_text=_('Path to the GPG binary.'), is_path=True
)
Example #23
0
from __future__ import unicode_literals

import pycountry

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

# TODO: Findout method to make languages names' translatable.
# YAML fails to serialize ugettext_lazy and ugettext is not allowed at this
# level

LANGUAGE_CHOICES = [(i.iso639_3_code, i.name)
                    for i in list(pycountry.languages)]

namespace = Namespace(name='documents', label=_('Documents'))
setting_storage_backend = namespace.add_setting(
    global_name='DOCUMENTS_STORAGE_BACKEND',
    default='storage.backends.filebasedstorage.FileBasedStorage')
setting_preview_size = namespace.add_setting(
    global_name='DOCUMENTS_PREVIEW_SIZE', default='640x480')
setting_print_size = namespace.add_setting(global_name='DOCUMENTS_PRINT_SIZE',
                                           default='3600')
setting_thumbnail_size = namespace.add_setting(
    global_name='DOCUMENTS_THUMBNAIL_SIZE', default='50x50')
setting_display_size = namespace.add_setting(
    global_name='DOCUMENTS_DISPLAY_SIZE', default='3600')
setting_recent_count = namespace.add_setting(
    global_name='DOCUMENTS_RECENT_COUNT',
    default=40,
    help_text=_(
Example #24
0
from __future__ import unicode_literals

import pycountry

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

LANGUAGE_CHOICES = [
    (i.iso639_3_code, i.name) for i in list(pycountry.languages)
]

namespace = Namespace(name='documents', label=_('Documents'))
setting_display_size = namespace.add_setting(
    global_name='DOCUMENTS_DISPLAY_SIZE', default='3600'
)
setting_preview_size = namespace.add_setting(
    global_name='DOCUMENTS_PREVIEW_SIZE', default='800'
)
setting_print_size = namespace.add_setting(
    global_name='DOCUMENTS_PRINT_SIZE', default='3600'
)
setting_thumbnail_size = namespace.add_setting(
    global_name='DOCUMENTS_THUMBNAIL_SIZE', default='800'
)
setting_recent_count = namespace.add_setting(
    global_name='DOCUMENTS_RECENT_COUNT', default=40,
    help_text=_(
        'Maximum number of recent (created, edited, viewed) documents to '
        'remember per user.'
    )
Example #25
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='dynamic_search', label=_('Search'))
setting_show_object_type = namespace.add_setting(
    global_name='SEARCH_SHOW_OBJECT_TYPE', default=False)
setting_limit = namespace.add_setting(
    global_name='SEARCH_LIMIT',
    default=100,
    help_text=_('Maximum amount search hits to fetch and display.'))
setting_recent_count = namespace.add_setting(
    global_name='SEARCH_RECENT_COUNT',
    default=5,
    help_text=_('Maximum number of search queries to remember per user.'))
Example #26
0
"""
This module should be called settings.py but is named conf.py to avoid a
clash with the mayan/settings/* module
"""
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='mayan', label=_('Mayan'))

setting_celery_class = namespace.add_setting(
    help_text=_('The class used to instantiate the main Celery app.'),
    global_name='MAYAN_CELERY_CLASS',
    default='celery.Celery')
Example #27
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='document_parsing', label=_('Document parsing'))

setting_auto_parsing = namespace.add_setting(
    global_name='DOCUMENT_PARSING_AUTO_PARSING',
    default=True,
    help_text=_(
        'Set new document types to perform parsing automatically by default.'))
setting_pdftotext_path = namespace.add_setting(
    global_name='DOCUMENT_PARSING_PDFTOTEXT_PATH',
    default='/usr/bin/pdftotext',
    help_text=_(
        'File path to poppler\'s pdftotext program used to extract text '
        'from PDF files.'),
    is_path=True)
Example #28
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='document_parsing', label=_('Document parsing'))

setting_pdftotext_path = namespace.add_setting(
    global_name='DOCUMENT_PARSING_PDFTOTEXT_PATH',
    default='/usr/bin/pdftotext',
    help_text=_(
        'File path to poppler\'s pdftotext program used to extract text '
        'from PDF files.'
    ),
    is_path=True
)
Example #29
0
from __future__ import unicode_literals

import os

from django.conf import settings
from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

from .literals import DEFAULT_LANGUAGE, DEFAULT_LANGUAGE_CODES

namespace = Namespace(name='documents', label=_('Documents'))

setting_documentimagecache_storage = namespace.add_setting(
    global_name='DOCUMENTS_CACHE_STORAGE_BACKEND',
    default='django.core.files.storage.FileSystemStorage', help_text=_(
        'Path to the Storage subclass to use when storing the cached '
        'document image files.'
    ), quoted=True
)
setting_documentimagecache_storage_arguments = namespace.add_setting(
    global_name='DOCUMENTS_CACHE_STORAGE_BACKEND_ARGUMENTS',
    default='{{location: {}}}'.format(
        os.path.join(settings.MEDIA_ROOT, 'document_cache')
    ), help_text=_(
        'Arguments to pass to the DOCUMENT_CACHE_STORAGE_BACKEND.'
    ), quoted=True,
)
setting_disable_base_image_cache = namespace.add_setting(
    global_name='DOCUMENTS_DISABLE_BASE_IMAGE_CACHE', default=False,
    help_text=_(
Example #30
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='signatures', label=_('Document signatures'))
setting_storage_backend = namespace.add_setting(
    global_name='SIGNATURES_STORAGE_BACKEND',
    default='storage.backends.filebasedstorage.FileBasedStorage')
Example #31
0
from __future__ import unicode_literals

import os
import tempfile

from django.conf import settings
from django.utils.translation import ugettext_lazy as _

import mayan
from smart_settings import Namespace

namespace = Namespace(name='common', label=_('Common'))

setting_auto_logging = namespace.add_setting(
    global_name='COMMON_AUTO_LOGGING',
    default=True,
    help_text=_('Automatically enable logging to all apps.')
)
settings_db_sync_task_delay = namespace.add_setting(
    global_name='COMMON_DB_SYNC_TASK_DELAY',
    default=2,
    help_text=_(
        'Time to delay background tasks that depend on a database commit to '
        'propagate.'
    )
)
setting_paginate_by = namespace.add_setting(
    global_name='COMMON_PAGINATE_BY',
    default=40,
    help_text=_(
        'An integer specifying how many objects should be displayed per page.'
Example #32
0
from __future__ import unicode_literals

import os

from django.conf import settings
from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='signatures', label=_('Document signatures'))
setting_storage_backend = namespace.add_setting(
    global_name='SIGNATURES_STORAGE_BACKEND',
    default='django.core.files.storage.FileSystemStorage')
setting_storage_backend_arguments = namespace.add_setting(
    global_name='SIGNATURES_STORAGE_BACKEND_ARGUMENTS',
    default='{{location: {}}}'.format(
        os.path.join(settings.MEDIA_ROOT, 'document_signatures')))
Example #33
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='converter', label=_('Converter'))
setting_graphics_backend = namespace.add_setting(
    default='converter.backends.python.Python',
    help_text=_('Graphics conversion backend to use.'),
    global_name='CONVERTER_GRAPHICS_BACKEND',
)
setting_libreoffice_path = namespace.add_setting(
    default='/usr/bin/libreoffice',
    global_name='CONVERTER_LIBREOFFICE_PATH',
    help_text=_('Path to the libreoffice program.'),
    is_path=True)
setting_pdftoppm_path = namespace.add_setting(
    default='/usr/bin/pdftoppm',
    global_name='CONVERTER_PDFTOPPM_PATH',
    help_text=_('Path to the Popple program pdftoppm.'),
    is_path=True)
Example #34
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

from .parsers import MetadataParser
from .validators import MetadataValidator

namespace = Namespace(name='metadata', label=_('Metadata'))
setting_available_validators = namespace.add_setting(
    global_name='METADATA_AVAILABLE_VALIDATORS',
    default=MetadataValidator.get_import_paths()
)
setting_available_parsers = namespace.add_setting(
    global_name='METADATA_AVAILABLE_PARSERS',
    default=MetadataParser.get_import_paths()
)
Example #35
0
from __future__ import unicode_literals

import os
import tempfile

from django.conf import settings
from django.utils.translation import ugettext_lazy as _

import mayan
from smart_settings import Namespace

namespace = Namespace(name='common', label=_('Common'))

setting_auto_logging = namespace.add_setting(
    global_name='COMMON_AUTO_LOGGING',
    default=True,
    help_text=_('Automatically enable logging to all apps.')
)
settings_db_sync_task_delay = namespace.add_setting(
    global_name='COMMON_DB_SYNC_TASK_DELAY',
    default=2,
    help_text=_(
        'Time to delay background tasks that depend on a database commit to '
        'propagate.'
    )
)
setting_paginate_by = namespace.add_setting(
    global_name='COMMON_PAGINATE_BY',
    default=40,
    help_text=_(
        'An integer specifying how many objects should be displayed per page.'
Example #36
0
from __future__ import unicode_literals

import os

from django.conf import settings
from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='sources', label=_('Sources'))

setting_scanimage_path = namespace.add_setting(
    global_name='SOURCES_SCANIMAGE_PATH', default='/usr/bin/scanimage',
    help_text=_(
        'File path to the scanimage program used to control image scanners.'
    ),
    is_path=True
)
setting_staging_file_image_cache_storage = namespace.add_setting(
    global_name='SOURCES_STAGING_FILE_CACHE_STORAGE_BACKEND',
    default='django.core.files.storage.FileSystemStorage', help_text=_(
        'Path to the Storage subclass to use when storing the cached '
        'staging_file image files.'
    ), quoted=True
)
setting_staging_file_image_cache_storage_arguments = namespace.add_setting(
    global_name='SOURCES_STAGING_FILE_CACHE_STORAGE_BACKEND_ARGUMENTS',
    default='{{location: {}}}'.format(
        os.path.join(settings.MEDIA_ROOT, 'staging_file_cache')
    ), help_text=_(
        'Arguments to pass to the SOURCES_STAGING_FILE_CACHE_STORAGE_BACKEND.'
Example #37
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

from .literals import (DEFAULT_DOCUMENT_BODY_TEMPLATE,
                       DEFAULT_LINK_BODY_TEMPLATE)

namespace = Namespace(name='mailer', label=_('Mailing'))

setting_link_subject_template = namespace.add_setting(
    default=_('Link for document: {{ document }}'),
    help_text=_('Template for the document link email form subject line.'),
    global_name='MAILER_LINK_SUBJECT_TEMPLATE',
    quoted=True)
setting_link_body_template = namespace.add_setting(
    default=DEFAULT_LINK_BODY_TEMPLATE,
    help_text=_(
        'Template for the document link email form body text. Can include HTML.'
    ),
    global_name='MAILER_LINK_BODY_TEMPLATE',
    quoted=True)
setting_document_subject_template = namespace.add_setting(
    default=_('Document: {{ document }}'),
    help_text=_('Template for the document email form subject line.'),
    global_name='MAILER_DOCUMENT_SUBJECT_TEMPLATE',
    quoted=True)
setting_document_body_template = namespace.add_setting(
    default=DEFAULT_DOCUMENT_BODY_TEMPLATE,
    help_text=_(
Example #38
0
from __future__ import unicode_literals

import tempfile

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='common', label=_('Common'))
setting_temporary_directory = namespace.add_setting(
    global_name='COMMON_TEMPORARY_DIRECTORY', default=tempfile.gettempdir(),
    help_text=_(
        'Temporary directory used site wide to store thumbnails, previews '
        'and temporary files.  If none is specified, one will be created '
        'using tempfile.mkdtemp().'
    ),
    is_path=True
)
setting_shared_storage = namespace.add_setting(
    global_name='COMMON_SHARED_STORAGE',
    default='storage.backends.filebasedstorage.FileBasedStorage',
    help_text=_('A storage backend that all workers can use to share files.')
)
setting_paginate_by = namespace.add_setting(
    global_name='COMMON_PAGINATE_BY',
    default=40,
    help_text=_(
        'An integer specifying how many objects should be displayed per page.'
    )
)
setting_auto_logging = namespace.add_setting(
Example #39
0
from __future__ import unicode_literals

import os

from django.conf import settings
from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

from .literals import DEFAULT_LANGUAGE, DEFAULT_LANGUAGE_CODES

namespace = Namespace(name='documents', label=_('Documents'))

setting_documentimagecache_storage = namespace.add_setting(
    global_name='DOCUMENTS_CACHE_STORAGE_BACKEND',
    default='django.core.files.storage.FileSystemStorage',
    help_text=_('Path to the Storage subclass to use when storing the cached '
                'document image files.'),
    quoted=True)
setting_documentimagecache_storage_arguments = namespace.add_setting(
    global_name='DOCUMENTS_CACHE_STORAGE_BACKEND_ARGUMENTS',
    default='{{location: {}}}'.format(
        os.path.join(settings.MEDIA_ROOT, 'document_cache')),
    help_text=_('Arguments to pass to the DOCUMENT_CACHE_STORAGE_BACKEND.'),
    quoted=True,
)
setting_disable_base_image_cache = namespace.add_setting(
    global_name='DOCUMENTS_DISABLE_BASE_IMAGE_CACHE',
    default=False,
    help_text=_('Disables the first cache tier which stores high resolution, '
                'non transformed versions of documents\'s pages.'))
Example #40
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

from .literals import DEFAULT_MAXIMUM_TITLE_LENGTH

namespace = Namespace(name='appearance', label=_('Appearance'))
setting_max_title_length = namespace.add_setting(
    default=DEFAULT_MAXIMUM_TITLE_LENGTH,
    global_name='APPEARANCE_MAXIMUM_TITLE_LENGTH', help_text=_(
        'Maximum number of characters that will be displayed as the view '
        'title.'
    )
)
Example #41
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

from .literals import (
    DEFAULT_LIBREOFFICE_PATH, DEFAULT_PDFTOPPM_DPI, DEFAULT_PDFTOPPM_FORMAT,
    DEFAULT_PDFTOPPM_PATH, DEFAULT_PDFINFO_PATH, DEFAULT_PILLOW_FORMAT
)

namespace = Namespace(name='converter', label=_('Converter'))
setting_graphics_backend = namespace.add_setting(
    default='converter.backends.python.Python',
    help_text=_('Graphics conversion backend to use.'),
    global_name='CONVERTER_GRAPHICS_BACKEND',
)
setting_graphics_backend_config = namespace.add_setting(
    default='''
        {{
            libreoffice_path: {},
            pdftoppm_dpi: {},
            pdftoppm_format: {},
            pdftoppm_path: {},
            pdfinfo_path: {},
            pillow_format: {}

        }}
    '''.replace('\n', '').format(
        DEFAULT_LIBREOFFICE_PATH, DEFAULT_PDFTOPPM_DPI,
        DEFAULT_PDFTOPPM_FORMAT, DEFAULT_PDFTOPPM_PATH, DEFAULT_PDFINFO_PATH,
Example #42
0
from __future__ import unicode_literals

import os

from django.conf import settings
from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='signatures', label=_('Document signatures'))
setting_storage_backend = namespace.add_setting(
    default='django.core.files.storage.FileSystemStorage',
    global_name='SIGNATURES_STORAGE_BACKEND', help_text=_(
        'Path to the Storage subclass to use when storing detached '
        'signatures.'
    )
)
setting_storage_backend_arguments = namespace.add_setting(
    global_name='SIGNATURES_STORAGE_BACKEND_ARGUMENTS',
    default='{{location: {}}}'.format(
        os.path.join(settings.MEDIA_ROOT, 'document_signatures')
    ), quoted=True, help_text=_(
        'Arguments to pass to the SIGNATURE_STORAGE_BACKEND. '
    )
)
Example #43
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace


namespace = Namespace(name='dynamic_search', label=_('Search'))
setting_show_object_type = namespace.add_setting(
    global_name='SEARCH_SHOW_OBJECT_TYPE', default=False
)
setting_limit = namespace.add_setting(
    global_name='SEARCH_LIMIT', default=100,
    help_text=_('Maximum amount search hits to fetch and display.')
)
setting_recent_count = namespace.add_setting(
    global_name='SEARCH_RECENT_COUNT', default=5,
    help_text=_('Maximum number of search queries to remember per user.')
)
Example #44
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='document_parsing', label=_('Document parsing'))

setting_auto_parsing = namespace.add_setting(
    global_name='DOCUMENT_PARSING_AUTO_PARSING', default=True,
    help_text=_(
        'Set new document types to perform parsing automatically by default.'
    )
)
setting_pdftotext_path = namespace.add_setting(
    global_name='DOCUMENT_PARSING_PDFTOTEXT_PATH',
    default='/usr/bin/pdftotext',
    help_text=_(
        'File path to poppler\'s pdftotext program used to extract text '
        'from PDF files.'
    ),
    is_path=True
)
Example #45
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='converter', label=_('Converter'))
setting_graphics_backend = namespace.add_setting(
    default='converter.backends.python.Python',
    help_text=_('Graphics conversion backend to use.'),
    global_name='CONVERTER_GRAPHICS_BACKEND',
)
setting_libreoffice_path = namespace.add_setting(
    default='/usr/bin/libreoffice',
    global_name='CONVERTER_LIBREOFFICE_PATH',
    help_text=_('Path to the libreoffice program.'), is_path=True
)
setting_pdftoppm_path = namespace.add_setting(
    default='/usr/bin/pdftoppm', global_name='CONVERTER_PDFTOPPM_PATH',
    help_text=_('Path to the Popple program pdftoppm.'), is_path=True
)
Example #46
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='ocr', label=_('OCR'))
setting_tesseract_path = namespace.add_setting(
    global_name='OCR_TESSERACT_PATH', default='/usr/bin/tesseract',
    help_text=_('File path to tesseract program.'), is_path=True
)
setting_pdftotext_path = namespace.add_setting(
    global_name='OCR_PDFTOTEXT_PATH', default='/usr/bin/pdftotext',
    help_text=_(
        'File path to poppler\'s pdftotext program used to extract text '
        'from PDF files.'
    ),
    is_path=True
)
setting_ocr_backend = namespace.add_setting(
    global_name='OCR_BACKEND', default='ocr.backends.tesseract.Tesseract',
    help_text=_('Full path to the backend to be used to do OCR.')
)
setting_auto_ocr = namespace.add_setting(
    global_name='OCR_AUTO_OCR', default=True,
    help_text=_(
        'Set new document types to perform OCR automatically by default.'
    )
)
Example #47
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='converter', label=_('Converter'))
setting_graphics_backend = namespace.add_setting(
    default='converter.backends.python.Python',
    help_text=_('Graphics conversion backend to use.'),
    global_name='CONVERTER_GRAPHICS_BACKEND',
)
setting_graphics_backend_config = namespace.add_setting(
    default='{libreoffice_path: /usr/bin/libreoffice, '
    'pdftoppm_path: /usr/bin/pdftoppm, pdfinfo_path: /usr/bin/pdfinfo}',
    help_text=_(
        'Configuration options for the graphics conversion backend.'
    ), global_name='CONVERTER_GRAPHICS_BACKEND_CONFIG',
)
Example #48
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name="authentication", label=_("Authentication"))
setting_login_method = namespace.add_setting(
    global_name="AUTHENTICATION_LOGIN_METHOD",
    default="username",
    help_text=_("Controls the mechanism used to authenticated user. Options are: " "username, email"),
)
from __future__ import unicode_literals

import pycountry

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

LANGUAGE_CHOICES = [(i.alpha_3, i.name) for i in list(pycountry.languages)]

namespace = Namespace(name='documents', label=_('Documents'))
setting_display_size = namespace.add_setting(
    global_name='DOCUMENTS_DISPLAY_SIZE', default='3600')
setting_preview_size = namespace.add_setting(
    global_name='DOCUMENTS_PREVIEW_SIZE', default='800')
setting_print_size = namespace.add_setting(global_name='DOCUMENTS_PRINT_SIZE',
                                           default='3600')
setting_thumbnail_size = namespace.add_setting(
    global_name='DOCUMENTS_THUMBNAIL_SIZE', default='800')
setting_recent_count = namespace.add_setting(
    global_name='DOCUMENTS_RECENT_COUNT',
    default=40,
    help_text=_(
        'Maximum number of recent (created, edited, viewed) documents to '
        'remember per user.'))
setting_storage_backend = namespace.add_setting(
    global_name='DOCUMENTS_STORAGE_BACKEND',
    default='storage.backends.filebasedstorage.FileBasedStorage')
setting_zoom_percent_step = namespace.add_setting(
    global_name='DOCUMENTS_ZOOM_PERCENT_STEP',
    default=25,
Example #50
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

from .literals import DEFAULT_MAXIMUM_TITLE_LENGTH

namespace = Namespace(name='appearance', label=_('Appearance'))
setting_max_title_length = namespace.add_setting(
    default=DEFAULT_MAXIMUM_TITLE_LENGTH,
    global_name='APPEARANCE_MAXIMUM_TITLE_LENGTH',
    help_text=_(
        'Maximum number of characters that will be displayed as the view '
        'title.'))
Example #51
0
from __future__ import unicode_literals

import os

from django.conf import settings
from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='django_gpg', label=_('Signatures'))
setting_gpg_home = namespace.add_setting(
    global_name='SIGNATURES_GPG_HOME',
    default=os.path.join(settings.MEDIA_ROOT, 'gpg_home'),
    help_text=_(
        'Home directory used to store keys as well as configuration files.'),
    is_path=True)
setting_gpg_path = namespace.add_setting(
    global_name='SIGNATURES_GPG_PATH',
    default='/usr/bin/gpg1',
    help_text=_('Path to the GPG binary.'),
    is_path=True)
setting_keyserver = namespace.add_setting(
    global_name='SIGNATURES_KEYSERVER',
    default='pool.sks-keyservers.net',
    help_text=_('Keyserver used to query for keys.'))
Example #52
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='ocr', label=_('OCR'))
setting_tesseract_path = namespace.add_setting(
    global_name='OCR_TESSERACT_PATH',
    default='/usr/bin/tesseract',
    help_text=_('File path to tesseract program.'),
    is_path=True)
setting_pdftotext_path = namespace.add_setting(
    global_name='OCR_PDFTOTEXT_PATH',
    default='/usr/bin/pdftotext',
    help_text=_(
        'File path to poppler\'s pdftotext program used to extract text '
        'from PDF files.'),
    is_path=True)
setting_ocr_backend = namespace.add_setting(
    global_name='OCR_BACKEND',
    default='ocr.backends.tesseract.Tesseract',
    help_text=_('Full path to the backend to be used to do OCR.'))
setting_auto_ocr = namespace.add_setting(
    global_name='OCR_AUTO_OCR',
    default=True,
    help_text=_(
        'Set new document types to perform OCR automatically by default.'))
Example #53
0
from __future__ import unicode_literals

import os

from django.conf import settings
from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

namespace = Namespace(name='signatures', label=_('Document signatures'))
setting_storage_backend = namespace.add_setting(
    default='django.core.files.storage.FileSystemStorage',
    global_name='SIGNATURES_STORAGE_BACKEND',
    help_text=_('Path to the Storage subclass to use when storing detached '
                'signatures.'))
setting_storage_backend_arguments = namespace.add_setting(
    global_name='SIGNATURES_STORAGE_BACKEND_ARGUMENTS',
    default='{{location: {}}}'.format(
        os.path.join(settings.MEDIA_ROOT, 'document_signatures')),
    quoted=True,
    help_text=_('Arguments to pass to the SIGNATURE_STORAGE_BACKEND. '))
Example #54
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from smart_settings import Namespace

from .literals import DEFAULT_LOGIN_METHOD, DEFAULT_MAXIMUM_SESSION_LENGTH

namespace = Namespace(name='authentication', label=_('Authentication'))
setting_login_method = namespace.add_setting(
    global_name='AUTHENTICATION_LOGIN_METHOD', default=DEFAULT_LOGIN_METHOD,
    help_text=_(
        'Controls the mechanism used to authenticated user. Options are: '
        'username, email'
    )
)
setting_maximum_session_length = namespace.add_setting(
    global_name='AUTHENTICATION_MAXIMUM_SESSION_LENGTH',
    default=DEFAULT_MAXIMUM_SESSION_LENGTH, help_text=_(
        'Maximum time an user clicking the "Remember me" checkbox will '
        'remain logged in. Value is time in seconds.'
    )
)