Quote:
Originally Posted by Doitsu
I haven't had time to test the new "optncx" branch. Will be bk.gettocid() return None for epub3 books without toc.ncx or will it raise a custom Sigil error?
|
It's all a part of master now, so you should be able to test the features pretty easily. And we encourage those who are able to do so, to do so. Precisely because of things like this that could be potentially overlooked.
In this case, I can confirm that bk.gettocid() returns None when no ncx exists.
My ancient NCXRemove plugin uses the following code:
Code:
ncxid = bk.gettocid()
if ncxid is None:
print('Error: EPUB 3.0 ebook has no NCX')
return -1
ncxhref = bk.id_to_href(ncxid)
without needing to resort to any Try/Except logic.