From 2a9ae520ed06df45342f8cea090a44fb538c0f7d Mon Sep 17 00:00:00 2001 From: kthoden Date: Mon, 2 Mar 2020 13:09:34 +0100 Subject: [PATCH] Fix paths --- src/imxml2epub.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/imxml2epub.py b/src/imxml2epub.py index 5c76b1b..ebe5981 100755 --- a/src/imxml2epub.py +++ b/src/imxml2epub.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8; mode: python -*- -# Time-stamp: <2020-02-28 17:33:23 (kthoden)> +# Time-stamp: <2020-02-28 18:10:10 (kthoden)> """ Convert a customized DocBook XML file into a set of files that constitute the contents of an EPUB file. @@ -158,10 +158,10 @@ else: logging.error("Found no publication.cfg. Exiting") sys.exit( 1 ) -if not os.path.exists( OUTPUT_DIR / "cover.jpg"): - logging.info(f"The file cover.jpg in {OUTPUT_DIR} directory is missing.") - if os.path.exists(PUBLICATION_DIR / "Cover.jpg"): - shutil.copy(PUBLICATION_DIR / "Cover.jpg", OUTPUT_DIR / "cover.jpg") +if not os.path.exists( OUTPUT_DIR / "Cover.jpg"): + logging.info(f"The file Cover.jpg in {OUTPUT_DIR} directory is missing.") + if os.path.exists(INPUT_DIR / "Cover.jpg"): + shutil.copy(INPUT_DIR / "Cover.jpg", OUTPUT_DIR / "cover.jpg") logging.info("Copied from current directory.") else: logging.error("No coverfile found. You can create a temporary one with the mkimage.py script")