mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
PDF metadata: If no metadata available, don't use full path as title. ebook-convert: If --help is specified, don't require the input file to exist.
This commit is contained in:
parent
0df9e9bd9d
commit
16cadc2a31
@ -57,7 +57,8 @@ def check_command_line_options(parser, args, log):
|
|||||||
raise SystemExit(1)
|
raise SystemExit(1)
|
||||||
|
|
||||||
input = os.path.abspath(args[1])
|
input = os.path.abspath(args[1])
|
||||||
if not input.endswith('.recipe') and not os.access(input, os.R_OK):
|
if not input.endswith('.recipe') and not os.access(input, os.R_OK) and not \
|
||||||
|
('-h' in args or '--help' in args):
|
||||||
log.error('Cannot read from', input)
|
log.error('Cannot read from', input)
|
||||||
raise SystemExit(1)
|
raise SystemExit(1)
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ def get_metadata(stream, cover=True):
|
|||||||
if not title or not title.strip():
|
if not title or not title.strip():
|
||||||
title = _('Unknown')
|
title = _('Unknown')
|
||||||
if hasattr(stream, 'name'):
|
if hasattr(stream, 'name'):
|
||||||
title = os.path.splitext(stream.name)[0]
|
title = os.path.splitext(os.path.basename(stream.name))[0]
|
||||||
author = doc.author
|
author = doc.author
|
||||||
authors = string_to_authors(author) if author else [_('Unknown')]
|
authors = string_to_authors(author) if author else [_('Unknown')]
|
||||||
creator = doc.creator
|
creator = doc.creator
|
||||||
|
Loading…
x
Reference in New Issue
Block a user