From bf976cb0aea0e3699fa1b2f4596e12f7e38114eb Mon Sep 17 00:00:00 2001 From: Thibaut Cuvelier Date: Sun, 7 Feb 2021 20:52:50 +0100 Subject: [PATCH] ePub: use None instead of an empty string. --- lib/scripts/docbook2epub.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/scripts/docbook2epub.py b/lib/scripts/docbook2epub.py index b3aba7aac9..35eda89431 100644 --- a/lib/scripts/docbook2epub.py +++ b/lib/scripts/docbook2epub.py @@ -31,9 +31,9 @@ class DocBookToEpub: sys.exit(1) self.own_path = sys.argv[0] - self.java_path = sys.argv[1] if sys.argv[1] != '' and sys.argv[1] != 'none' else '' - self.xsltproc_path = sys.argv[2] if sys.argv[2] != '' and sys.argv[2] != 'none' else '' - self.xslt_path = sys.argv[3] if sys.argv[3] != '' and sys.argv[3] != 'none' else '' + self.java_path = sys.argv[1] if sys.argv[1] != '' and sys.argv[1] != 'none' else None + self.xsltproc_path = sys.argv[2] if sys.argv[2] != '' and sys.argv[2] != 'none' else None + self.xslt_path = sys.argv[3] if sys.argv[3] != '' and sys.argv[3] != 'none' else None self.input = sys.argv[4] self.output = sys.argv[5] self.script_folder = os.path.dirname(self.own_path) + '/../' @@ -50,7 +50,7 @@ class DocBookToEpub: self.package_opf = self.output_dir + '/OEBPS/package.opf' # Does not exist yet, print('Temporary output directory: %s' % self.output_dir) - if self.xslt_path == '': + if self.xslt_path is None: self.xslt = self.script_folder + 'docbook/epub3/chunk.xsl' else: self.xslt = self.xslt_path + '/epub3/chunk.xsl' @@ -67,9 +67,9 @@ class DocBookToEpub: def start_xslt_transformation(self): command = None - if self.xsltproc_path != '': + if self.xsltproc_path is not None: command = self.start_xslt_transformation_xsltproc() - elif self.java_path != '': + elif self.java_path is not None: command = self.start_xslt_transformation_saxon6() if command is None: