Add command 'setcover'.
This commit is contained in:
parent
43d5195367
commit
e656432802
1 changed files with 23 additions and 0 deletions
23
epubfile.py
23
epubfile.py
|
|
@ -1627,6 +1627,11 @@ def normalize_argparse(args):
|
|||
pipeable.stdout(epub.absolute_path)
|
||||
return 0
|
||||
|
||||
def setcover_argparse(args):
|
||||
book = Epub(args.epub)
|
||||
book.set_cover_image(args.cover_id)
|
||||
return 0
|
||||
|
||||
def setfont(book, new_font, autoyes=False):
|
||||
css_id = 'epubfile_setfont'
|
||||
css_basename = 'epubfile_setfont.css'
|
||||
|
|
@ -1927,6 +1932,24 @@ def main(argv):
|
|||
|
||||
################################################################################################
|
||||
|
||||
p_setcover = subparsers.add_parser(
|
||||
'setcover',
|
||||
description='''
|
||||
Set the book's cover image to the specified manifest ID.
|
||||
|
||||
You can use the manifest command first to see what's in the book.
|
||||
''',
|
||||
)
|
||||
p_setcover.add_argument(
|
||||
'epub',
|
||||
)
|
||||
p_setcover.add_argument(
|
||||
'cover_id',
|
||||
)
|
||||
p_setcover.set_defaults(func=setcover_argparse)
|
||||
|
||||
################################################################################################
|
||||
|
||||
p_setfont = subparsers.add_parser(
|
||||
'setfont',
|
||||
description='''
|
||||
|
|
|
|||
Loading…
Reference in a new issue