From a9102cf8778a49ff0816e138face55caa93334d8 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 18 Aug 2019 19:53:54 -0700 Subject: [PATCH] Add the holdit command. --- epubfile.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/epubfile.py b/epubfile.py index c22e480..714d21b 100644 --- a/epubfile.py +++ b/epubfile.py @@ -900,6 +900,8 @@ DOCSTRING = ''' {covercomesfirst} +{holdit} + {merge} {normalize} @@ -930,6 +932,14 @@ covercomesfirst: first, otherwise some /a/image.jpg will always be before /images/cover.jpg. '''.strip(), +'holdit': +''' +holdit: + Extract the book and leave it open for manual editing, then save. + + > epubfile.py holdit book.epub +''', + 'merge': ''' merge: @@ -1022,6 +1032,12 @@ def covercomesfirst_argparse(args): book.save(args.epub) +def holdit_argparse(args): + book = Epub.open(args.epub) + print(book.root_directory.absolute_path) + input('Press Enter when ready.') + book.save(args.epub) + def merge(input_filepaths, output_filename, do_headerfile=False): book = Epub.new() @@ -1106,6 +1122,10 @@ def main(argv): p_covercomesfirst.add_argument('epub') p_covercomesfirst.set_defaults(func=covercomesfirst_argparse) + p_holdit = subparsers.add_parser('holdit') + p_holdit.add_argument('epub') + p_holdit.set_defaults(func=holdit_argparse) + p_merge = subparsers.add_parser('merge') p_merge.add_argument('epubs', nargs='+', default=[]) p_merge.add_argument('--output', dest='output', default=None, required=True)