From: Radek Czajka Date: Wed, 14 Jul 2010 10:20:47 +0000 (+0200) Subject: minor fix X-Git-Tag: 1.7~281 X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/90cbf4aecef5caa3f2a819f1c9072626a4f18d96?ds=sidebyside;hp=585a9666a5ae9264f531248bad4e08e75636442c minor fix --- 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'))