From 1843490897e2db9fecd3df669eb6d48082dd7574 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 6 May 2010 12:03:25 -0600 Subject: [PATCH] EPUB Output: Add a warning if the generated EPUB has no Table of Contents --- src/calibre/ebooks/epub/output.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/calibre/ebooks/epub/output.py b/src/calibre/ebooks/epub/output.py index fd96bfdb94..129a63ef3c 100644 --- a/src/calibre/ebooks/epub/output.py +++ b/src/calibre/ebooks/epub/output.py @@ -171,6 +171,10 @@ class EPUBOutput(OutputFormatPlugin): self.workaround_sony_quirks() + if self.oeb.toc.count() == 0: + self.log.warn('This EPUB file has no Table of Contents. It will ' + 'not validate via epubcheck') + from calibre.ebooks.oeb.base import OPF identifiers = oeb.metadata['identifier'] uuid = None