Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 10-06-2017, 02:46 AM   #1
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,582
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
[Plugin] DeleteUnmanifestedFiles

Updated: 8 October 2019
Current Version: "0.1.2"

This simple plugin will delete files that third-party apps might write to the ePub temp folder.
Note that this plugin will delete all unmanifested files, except for files in the META-INF folder.
For example, it won't delete com.apple.ibooks.display-options.xml.

Installation:

1. Select Manage Plugins from the Plugins menu and select Use Bundled Python, if it isn't already selected.
2. Click Add Plugin and select DeleteUnmanifestedFiles_v0.1.2.zip. This will install the DeleteUnmanifestedFiles edit plugin, which you can select via Plugins > Edit > DeleteUnmanifestedFiles.

License: GNU General Public License v3 (GPL-3)
Attached Files
File Type: zip DeleteUnmanifestedFiles_v0.1.2.zip (1.3 KB, 1106 views)

Last edited by Doitsu; 10-08-2019 at 12:01 PM. Reason: Updated version with minor updates attached
Doitsu is offline   Reply With Quote
Old 10-10-2017, 04:49 PM   #2
jcsalomon
Zealot
jcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheese
 
jcsalomon's Avatar
 
Posts: 100
Karma: 1204
Join Date: Jun 2012
Device: Bookari (née Mantano Reader) on Android; Kindle Fire HD
Quote:
Originally Posted by DiapDealer View Post
Also ... I'm sure there's probably more "allowable" unmanifested files that will only become apparent after you've released your plugin (not that I can think of any offhand). A way for the user to exempt specific files (or file-types) might stave off future trouble.
Here’s an example. I’m using a font whose license says, “If you redistribute the font file in this archive, it must be accompanied by all the other files from this archive, including this one.” The most straightforward way to comply with this is to include the Readme.txt and License.txt files in the EPUB’s Misc folder but (since nobody who’s just reading the book ever has to see those files) not include them in the manifest.

… On second look, actually they do seem to have entries in content.opf’s <manifest> section, since I added them via Sigil’s interface. But ought they to?
jcsalomon is offline   Reply With Quote
Advert
Old 10-10-2017, 05:00 PM   #3
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,539
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by jcsalomon View Post
… On second look, actually they do seem to have entries in content.opf’s <manifest> section, since I added them via Sigil’s interface. But ought they to?
Not sure really. But they will probably cause warnings/errors with validators either way: manifested but unused, or unmanifested members of the archive.

But as mentioned elsewhere, totally unmanifested files (except for the special mimetype file and what's in the META-INF folder) won't likely survive consecutive Sigil saves anyway.

Last edited by DiapDealer; 10-10-2017 at 05:04 PM.
DiapDealer is offline   Reply With Quote
Old 10-10-2017, 05:08 PM   #4
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,582
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by jcsalomon View Post
Here’s an example.The most straightforward way to comply with this is to include the Readme.txt and License.txt files in the EPUB’s Misc folder[...]
IMHO, the most straightforward way would be to drop these files in the META-INF folder, because it isn't checked by epubcheck.
(Epubcheck only checks for the presence of container.xml and the content.opf path.)
However, since Sigil will delete .txt files from the META-INF folder upon opening the ePub, you'll have to add them after you've finalized the epub.
Doitsu is offline   Reply With Quote
Old 10-10-2017, 05:25 PM   #5
jcsalomon
Zealot
jcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheese
 
jcsalomon's Avatar
 
Posts: 100
Karma: 1204
Join Date: Jun 2012
Device: Bookari (née Mantano Reader) on Android; Kindle Fire HD
Quote:
Originally Posted by DiapDealer View Post
Not sure really. But they will probably cause warnings/errors with validators either way: manifested but unused, or unmanifested members of the archive.
EpubCheck, at least, is happy with manifested but unused, and since…

Quote:
Originally Posted by DiapDealer View Post
But as mentioned elsewhere, totally unmanifested files (except for the special mimetype file and what's in the META-INF folder) won't likely survive consecutive Sigil saves anyway.
… I think I’ll stick with what I’m doing: manifested files in Misc/ which are not referenced otherwise.
jcsalomon is offline   Reply With Quote
Advert
Old 10-16-2017, 10:51 AM   #6
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,603
Karma: 5433388
Join Date: Nov 2009
Device: many
BTW: If unmanifested files are present in an ebook at the time a plugin is launched you can get access to all unmanifested files in bk.other_iter() and you should be able to use the normal interface to delete them.

Code:
    # all other ebook files not in the manifest
    print("\nExercising: bk.other_iter()")
    for book_href in bk.other_iter():
        print(book_href)
obviously deleting META-INF/container.xml or the OEBPS/content.opf would not be a good idea ;-) but that iterator should give you the names of all unmanifested files to play with.

So please consider trying the provided iterator approach and if you run into trouble, let me know and I will fix any unearthed bugs.

Last edited by KevinH; 10-16-2017 at 11:34 AM. Reason: update to be a suggestion
KevinH is offline   Reply With Quote
Old 01-13-2024, 01:18 AM   #7
luc80
Junior Member
luc80 began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jan 2024
Device: kindle paperwhite
Hi, I have a question about deleting unmanifested files.

While making an EPUB in Sigil I accidentally imported two photoshop files while dragging in a group of gifs. I didn't know how to find and remove them as they didn't show up in the images folder. So they were flagged when I went to publish my ebook on Drafts2Digital and Kobo.

Without knowing how to remove the files, I deleted the reference in the .obf file and this got me through the Drafts2Digital check but Kobo still warned me about the bad files.

Then I discovered this thread and used the DeleteUnmanifestedFiles plugin. Sigil told me it had removed the offending files.

However, when I went to reupload this file to Kobo, Kobo still complained about the files.

I went ahead and published it anyway. But can anybody help me understand why Kobo would flag the file again, or if it might still be a problem?

Thanks
luc80 is offline   Reply With Quote
Old 01-13-2024, 09:16 AM   #8
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,603
Karma: 5433388
Join Date: Nov 2009
Device: many
Did you remember to save the epub after using this plugin?

You can always manually check by copying the epub to a new file replacing the .epub extension with .zip (epub files are zip archives with some added bells and whistles).

Then just unzip that copy, and do a search for the files you are worried about.
KevinH is offline   Reply With Quote
Old 01-13-2024, 03:41 PM   #9
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,582
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
@luc80 as KevinH has already pointed out, you'll need to save the file in Sigil after running the DeleteUnmanifestedFiles plugin.
You can test whether it worked by re-opening the book. If you no longer get an unmanifested files warning by Sigil, the unmanifested files have been successfully removed.
Doitsu is offline   Reply With Quote
Old 01-14-2024, 12:08 AM   #10
luc80
Junior Member
luc80 began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jan 2024
Device: kindle paperwhite
Hi, yes I managed to get it to work.
I'm positive I had saved it because I obsessively do that, but I didn't close the file and not sure if that made a difference.
I closed the file and opened it again and Sigil told me the files were still there. So I repeated the clean-up and closed and opened it again and it worked.
I can't explain what happened.
Anyway appreciate the plugin as it saved me after getting those .psd files stuck in there.
luc80 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[FileType Plugin] YVES Bible Plugin ClashTheBunny Plugins 27 01-16-2023 01:25 AM
Goodread Perception Expander plugin not shown on plugin list (kobo h2o) www KOReader 4 09-28-2017 10:34 AM
Problem with my ScrambleEbook plugin and the Plugin Updater tool jackie_w Development 14 01-19-2017 10:49 PM
Plugin not customizable: Plugin: HTML Output does not need customization flyingfoxlee Conversion 2 02-24-2012 02:24 AM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 01:25 PM.


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