Settings: Update defaults formats

Update the default values of the settings which pass
arguments to backends to be valid Python values and not
YAML strings.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2018-11-26 17:45:43 -04:00
parent 5c1eb59a1a
commit 51f15a3131
6 changed files with 21 additions and 32 deletions

View File

@@ -65,9 +65,7 @@ setting_shared_storage = namespace.add_setting(
) )
setting_shared_storage_arguments = namespace.add_setting( setting_shared_storage_arguments = namespace.add_setting(
global_name='COMMON_SHARED_STORAGE_ARGUMENTS', global_name='COMMON_SHARED_STORAGE_ARGUMENTS',
default='{{location: {}}}'.format( default={'location': os.path.join(settings.MEDIA_ROOT, 'shared_files')}
os.path.join(settings.MEDIA_ROOT, 'shared_files')
)
) )
setting_temporary_directory = namespace.add_setting( setting_temporary_directory = namespace.add_setting(
global_name='COMMON_TEMPORARY_DIRECTORY', default=tempfile.gettempdir(), global_name='COMMON_TEMPORARY_DIRECTORY', default=tempfile.gettempdir(),

View File

@@ -16,21 +16,14 @@ setting_graphics_backend = namespace.add_setting(
global_name='CONVERTER_GRAPHICS_BACKEND', global_name='CONVERTER_GRAPHICS_BACKEND',
) )
setting_graphics_backend_arguments = namespace.add_setting( setting_graphics_backend_arguments = namespace.add_setting(
default=''' default={
{{ 'libreoffice_path': DEFAULT_LIBREOFFICE_PATH,
libreoffice_path: {}, 'pdftoppm_dpi': DEFAULT_PDFTOPPM_DPI,
pdftoppm_dpi: {}, 'pdftoppm_format': DEFAULT_PDFTOPPM_FORMAT,
pdftoppm_format: {}, 'pdftoppm_path': DEFAULT_PDFTOPPM_PATH,
pdftoppm_path: {}, 'pdfinfo_path': DEFAULT_PDFINFO_PATH,
pdfinfo_path: {}, 'pillow_format': DEFAULT_PILLOW_FORMAT
pillow_format: {} }, help_text=_(
}}
'''.replace('\n', '').format(
DEFAULT_LIBREOFFICE_PATH, DEFAULT_PDFTOPPM_DPI,
DEFAULT_PDFTOPPM_FORMAT, DEFAULT_PDFTOPPM_PATH, DEFAULT_PDFINFO_PATH,
DEFAULT_PILLOW_FORMAT
), help_text=_(
'Configuration options for the graphics conversion backend.' 'Configuration options for the graphics conversion backend.'
), global_name='CONVERTER_GRAPHICS_BACKEND_ARGUMENTS' ), global_name='CONVERTER_GRAPHICS_BACKEND_ARGUMENTS'
) )

View File

@@ -17,9 +17,9 @@ setting_storage_backend = namespace.add_setting(
) )
setting_storage_backend_arguments = namespace.add_setting( setting_storage_backend_arguments = namespace.add_setting(
global_name='SIGNATURES_STORAGE_BACKEND_ARGUMENTS', global_name='SIGNATURES_STORAGE_BACKEND_ARGUMENTS',
default='{{location: {}}}'.format( default={
os.path.join(settings.MEDIA_ROOT, 'document_signatures') 'location': os.path.join(settings.MEDIA_ROOT, 'document_signatures')
), help_text=_( }, help_text=_(
'Arguments to pass to the SIGNATURE_STORAGE_BACKEND. ' 'Arguments to pass to the SIGNATURE_STORAGE_BACKEND. '
) )
) )

View File

@@ -20,9 +20,8 @@ setting_documentimagecache_storage = namespace.add_setting(
) )
setting_documentimagecache_storage_arguments = namespace.add_setting( setting_documentimagecache_storage_arguments = namespace.add_setting(
global_name='DOCUMENTS_CACHE_STORAGE_BACKEND_ARGUMENTS', global_name='DOCUMENTS_CACHE_STORAGE_BACKEND_ARGUMENTS',
default='{{location: {}}}'.format( default={'location': os.path.join(settings.MEDIA_ROOT, 'document_cache')},
os.path.join(settings.MEDIA_ROOT, 'document_cache') help_text=_(
), help_text=_(
'Arguments to pass to the DOCUMENT_CACHE_STORAGE_BACKEND.' 'Arguments to pass to the DOCUMENT_CACHE_STORAGE_BACKEND.'
) )
) )
@@ -117,9 +116,9 @@ setting_storage_backend = namespace.add_setting(
) )
setting_storage_backend_arguments = namespace.add_setting( setting_storage_backend_arguments = namespace.add_setting(
global_name='DOCUMENTS_STORAGE_BACKEND_ARGUMENTS', global_name='DOCUMENTS_STORAGE_BACKEND_ARGUMENTS',
default='{{location: {}}}'.format( default={
os.path.join(settings.MEDIA_ROOT, 'document_storage') 'location': os.path.join(settings.MEDIA_ROOT, 'document_storage')
), help_text=_('Arguments to pass to the DOCUMENT_STORAGE_BACKEND.') }, help_text=_('Arguments to pass to the DOCUMENT_STORAGE_BACKEND.')
) )
setting_thumbnail_height = namespace.add_setting( setting_thumbnail_height = namespace.add_setting(
global_name='DOCUMENTS_THUMBNAIL_HEIGHT', default='', help_text=_( global_name='DOCUMENTS_THUMBNAIL_HEIGHT', default='', help_text=_(

View File

@@ -11,8 +11,7 @@ setting_ocr_backend = namespace.add_setting(
help_text=_('Full path to the backend to be used to do OCR.') help_text=_('Full path to the backend to be used to do OCR.')
) )
setting_ocr_backend_arguments = namespace.add_setting( setting_ocr_backend_arguments = namespace.add_setting(
global_name='OCR_BACKEND_ARGUMENTS', global_name='OCR_BACKEND_ARGUMENTS', default={}
default='{}'
) )
setting_auto_ocr = namespace.add_setting( setting_auto_ocr = namespace.add_setting(
global_name='OCR_AUTO_OCR', default=True, global_name='OCR_AUTO_OCR', default=True,

View File

@@ -25,9 +25,9 @@ setting_staging_file_image_cache_storage = namespace.add_setting(
) )
setting_staging_file_image_cache_storage_arguments = namespace.add_setting( setting_staging_file_image_cache_storage_arguments = namespace.add_setting(
global_name='SOURCES_STAGING_FILE_CACHE_STORAGE_BACKEND_ARGUMENTS', global_name='SOURCES_STAGING_FILE_CACHE_STORAGE_BACKEND_ARGUMENTS',
default='{{location: {}}}'.format( default={
os.path.join(settings.MEDIA_ROOT, 'staging_file_cache') 'location': os.path.join(settings.MEDIA_ROOT, 'staging_file_cache')
), help_text=_( }, help_text=_(
'Arguments to pass to the SOURCES_STAGING_FILE_CACHE_STORAGE_BACKEND.' 'Arguments to pass to the SOURCES_STAGING_FILE_CACHE_STORAGE_BACKEND.'
) )
) )