calibredb catalog: Recognize file extensions even when they are not lowercase

This commit is contained in:
Kovid Goyal 2018-07-12 20:53:38 +05:30
parent 1b902b7a68
commit 439da63e81
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -108,7 +108,7 @@ def main(opts, args, dbctx):
raise SystemExit(_('You must specify a catalog output file')) raise SystemExit(_('You must specify a catalog output file'))
if opts.ids: if opts.ids:
opts.ids = list(integers_from_string(opts.ids)) opts.ids = list(integers_from_string(opts.ids))
fmt = args[0].rpartition('.')[-1] fmt = args[0].rpartition('.')[-1].lower()
if fmt not in available_catalog_formats(): if fmt not in available_catalog_formats():
raise SystemExit( raise SystemExit(
_('Cannot generate a catalog in the {} format').format(fmt.upper()) _('Cannot generate a catalog in the {} format').format(fmt.upper())