Exemplo n.º 1
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from mayan.apps.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(label=_('Converter'), name='converter')

setting_graphics_backend = namespace.add_setting(
    default='mayan.apps.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,
Exemplo n.º 2
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from mayan.apps.smart_settings import Namespace

from .literals import DEFAULT_MAXIMUM_TITLE_LENGTH

namespace = Namespace(label=_('Appearance'), name='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.'))
Exemplo n.º 3
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from mayan.apps.smart_settings import Namespace

namespace = Namespace(label=_('Document parsing'), name='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
)
Exemplo n.º 4
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from mayan.apps.smart_settings import Namespace

from .literals import DEFAULT_EXIF_PATH

namespace = Namespace(label=_('File metadata'), name='file_metadata')

setting_auto_process = namespace.add_setting(
    global_name='FILE_METADATA_AUTO_PROCESS', default=True,
    help_text=_(
        'Set new document types to perform file metadata processing '
        'automatically by default.'
    )
)
setting_drivers_arguments = namespace.add_setting(
    default='''
        {{
            exif_driver: {{exiftool_path: {}}},

        }}
    '''.replace('\n', '').format(DEFAULT_EXIF_PATH), help_text=_(
        'Arguments to pass to the drivers.'
    ), global_name='FILE_METADATA_DRIVERS_ARGUMENTS', quoted=True
)
Exemplo n.º 5
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from mayan.apps.smart_settings import Namespace

from .parsers import MetadataParser
from .validators import MetadataValidator

namespace = Namespace(label=_('Metadata'), name='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())
Exemplo n.º 6
0
from __future__ import unicode_literals

import tempfile

from django.utils.translation import ugettext_lazy as _

from mayan.apps.smart_settings import Namespace

namespace = Namespace(label=_('Storage'), name='storage')

setting_temporary_directory = namespace.add_setting(
    global_name='STORAGE_TEMPORARY_DIRECTORY',
    default=tempfile.gettempdir(),
    help_text=_(
        'Temporary directory used site wide to store thumbnails, previews '
        'and temporary files.'))
Exemplo n.º 7
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 mayan.apps.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'
)
Exemplo n.º 8
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from mayan.apps.smart_settings import Namespace

from .literals import DEFAULT_BACKEND, DEFAULT_LOCK_TIMEOUT_VALUE

namespace = Namespace(label=_('Lock manager'), name='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.'))
Exemplo n.º 9
0
from __future__ import unicode_literals

import os

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

from mayan.apps.smart_settings import Namespace

namespace = Namespace(label=_('Signatures'), name='django_gpg')

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.'))
Exemplo n.º 10
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from mayan.apps.smart_settings import Namespace

from .literals import (DEFAULT_DOCUMENT_BODY_TEMPLATE,
                       DEFAULT_LINK_BODY_TEMPLATE)

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

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=_(
Exemplo n.º 11
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from mayan.apps.smart_settings import Namespace

from .literals import DEFAULT_EMAIL, DEFAULT_PASSWORD, DEFAULT_USERNAME

namespace = Namespace(label=_('Auto administrator'), name='autoadmin')

setting_email = namespace.add_setting(
    global_name='AUTOADMIN_EMAIL',
    default=DEFAULT_EMAIL,
    help_text=_(
        'Sets the email of the automatically created super user account.'))
setting_password = namespace.add_setting(
    global_name='AUTOADMIN_PASSWORD',
    default=DEFAULT_PASSWORD,
    help_text=_(
        'The password of the automatically created super user account. '
        'If it is equal to None, the password is randomly generated.'))
setting_username = namespace.add_setting(
    global_name='AUTOADMIN_USERNAME',
    default=DEFAULT_USERNAME,
    help_text=_(
        'The username of the automatically created super user account.'))
Exemplo n.º 12
0
from __future__ import unicode_literals

import os

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

import mayan
from mayan.apps.smart_settings import Namespace

from .literals import DEFAULT_COMMON_HOME_VIEW


namespace = Namespace(label=_('Common'), name='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_home_view = namespace.add_setting(
    global_name='COMMON_HOME_VIEW',
    default=DEFAULT_COMMON_HOME_VIEW, help_text=_(
Exemplo n.º 13
0
from __future__ import unicode_literals

import os

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

from mayan.apps.smart_settings import Namespace

namespace = Namespace(label=_('Document signatures'), name='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. '))
Exemplo n.º 14
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from mayan.apps.smart_settings import Namespace

from .literals import DEFAULT_LOGIN_METHOD, DEFAULT_MAXIMUM_SESSION_LENGTH

namespace = Namespace(label=_('Authentication'), name='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 a user clicking the "Remember me" checkbox will '
                'remain logged in. Value is time in seconds.'))
Exemplo n.º 15
0
from __future__ import unicode_literals

import os

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

from mayan.apps.smart_settings import Namespace

from .literals import (
    DEFAULT_DOCUMENTS_HASH_BLOCK_SIZE, DEFAULT_LANGUAGE, DEFAULT_LANGUAGE_CODES
)

namespace = Namespace(label=_('Documents'), name='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(
Exemplo n.º 16
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from mayan.apps.smart_settings import Namespace

namespace = Namespace(label=_('Mirroring'), name='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.'),
)
Exemplo n.º 17
0
from __future__ import unicode_literals

import os

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

from mayan.apps.smart_settings import Namespace

namespace = Namespace(label=_('Sources'), name='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.'
Exemplo n.º 18
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from mayan.apps.smart_settings import Namespace

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

setting_ocr_backend = namespace.add_setting(
    global_name='OCR_BACKEND',
    default='mayan.apps.ocr.backends.tesseract.Tesseract',
    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.'))