View Single Post
Old 09-10-2020, 02:24 PM   #21
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: 8,893
Karma: 6120478
Join Date: Nov 2009
Device: many
I checked and for groups (think of resource types here) that have no instances, a guess is made based on the current resource type and backfilled into the default for that type.

This is done when the opf is parsed.

See the code after here:

https://github.com/Sigil-Ebook/Sigil...parser.py#L278

It uses the resource type (case adjusted to match existing uses of case) as the default folder path. This was to match standard locations by default unless otherwise specified.

I personally like to use bk.addbookpath() in Sigil plugins post Sigil 1.0 when I want to control the exact path.

FWIW, Another approach I have used in my own plugins is to use normal addfile to create the file but with empty data and the use its returned id to get its bookpath (whatever that turned out to be) and then write any adjusted contents to that added but empty file.

Last edited by KevinH; 09-10-2020 at 02:31 PM.
KevinH is offline   Reply With Quote