Added additional config options

This commit is contained in:
Ozzieisaacs
2020-05-02 10:18:01 +02:00
parent 9bc085a23e
commit 0138ff9e16
8 changed files with 47 additions and 45 deletions

View File

@@ -29,8 +29,8 @@ log = logger.create()
# _() necessary to make babel aware of string for translation
_NOT_CONFIGURED = _('not configured')
_NOT_INSTALLED = 'not installed'
_EXECUTION_ERROR = 'Execution permissions missing'
_NOT_INSTALLED = _('not installed')
_EXECUTION_ERROR = _('Execution permissions missing')
def _get_command_version(path, pattern, argument=None):
@@ -49,14 +49,11 @@ def _get_command_version(path, pattern, argument=None):
def get_calibre_version():
version = None
if config.config_ebookconverter == 2:
version = _get_command_version(config.config_converterpath, r'ebook-convert.*\(calibre', '--version')
return version or _NOT_CONFIGURED
# version = None
# if config.config_ebookconverter == 2:
return _get_command_version(config.config_converterpath, r'ebook-convert.*\(calibre', '--version') \
or _NOT_CONFIGURED
def get_unrar_version():
version = None
if config.config_ebookconverter == 2:
version = _get_command_version(config.config_converterpath, r'ebook-convert.*\(calibre', '--version')
return version or _NOT_CONFIGURED
return _get_command_version(config.config_rarfile_location, r'UNRAR.*\d') or _NOT_CONFIGURED