Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 07-11-2019, 11:52 AM   #31
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,546
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Doitsu View Post
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.
DiapDealer is offline   Reply With Quote
Old 07-11-2019, 11:53 AM   #32
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,633
Karma: 5433388
Join Date: Nov 2009
Device: many
BTW, the optncx branch is now merged into master and deleted. So anyone who wants to test these changes can do a pull from master.
KevinH is offline   Reply With Quote
Old 07-11-2019, 11:54 AM   #33
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,633
Karma: 5433388
Join Date: Nov 2009
Device: many
@DiapDealer - we keep saying almost exactly the same thing!

edit: So it must be true great minds think alike! ;-)
KevinH is offline   Reply With Quote
Old 07-11-2019, 12:11 PM   #34
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,546
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by KevinH View Post
edit: So it must be true great minds think alike! ;-)
It HAS to be.
DiapDealer is offline   Reply With Quote
Old 07-11-2019, 12:39 PM   #35
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by DiapDealer View Post
In this case, I can confirm that bk.gettocid() returns None when no ncx exists.
Thanks for checking this! AFAIK, only one of my plugins uses bk.gettocid() and it'll display a warning if bk.gettocid() returns None.
Doitsu is offline   Reply With Quote
Old 07-11-2019, 01:01 PM   #36
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,546
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Doitsu View Post
Thanks for checking this! AFAIK, only one of my plugins uses bk.gettocid() and it'll display a warning if bk.gettocid() returns None.
Yeah ... I don't really expect much trouble at all. But I wanted to give a heads up in case someone made the assumption in their code that the ncx would always be there (since it always has been until now).

My input plugin DOCXImport will automatically create an ncx for an EPUB3, but since it will be able to be removed (or created for compatibility), there's no real hurry (or incentive) for me to modify the plugin.

I probably wouldn't change it anyway, since older versions of Sigil would still need the ncx created--and checking for specific versions of Sigil just to see if a dummy ncx should be created on import or not seems like overkill.
DiapDealer is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple epub:type roles for a file in landmarks nav jcsalomon Sigil 0 02-20-2018 02:08 PM
fixed layout landmarks issue leijoninna ePub 11 06-14-2013 04:24 AM
Free (Kindle/Nook) A Beginner's Guide to Using Your iPad as a Business Tool greencat Deals and Resources (No Self-Promotion or Affiliate Links) 4 10-04-2011 09:50 PM
Free (Kindle) A Beginner's Guide to Using Your iPhone as a Business Productivity Tool arcadata Deals and Resources (No Self-Promotion or Affiliate Links) 0 08-29-2011 03:34 AM
Using privately owned landmarks mr ploppy Writers' Corner 8 08-10-2011 01:51 PM


All times are GMT -4. The time now is 10:02 AM.


MobileRead.com is a privately owned, operated and funded community.