From 90cbf4aecef5caa3f2a819f1c9072626a4f18d96 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Wed, 14 Jul 2010 12:20:47 +0200 Subject: [PATCH 1/1] minor fix --- librarian/epub.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/librarian/epub.py b/librarian/epub.py index 50f9562..201799b 100644 --- a/librarian/epub.py +++ b/librarian/epub.py @@ -342,6 +342,8 @@ def transform(input_file, output_file): if __name__ == '__main__': + import html + if len(sys.argv) < 2: print >> sys.stderr, 'Usage: wl2epub [output file]' sys.exit(1) @@ -353,7 +355,10 @@ if __name__ == '__main__': basename, ext = os.path.splitext(input) output = basename + '.epub' - wl2epub(open(input, 'r'), open(output, 'w')) + print input + if html.transform(input, is_file=True) == '': + print 'empty content - skipping' + transform(open(input, 'r'), open(output, 'w')) -- 2.20.1