10-07-2022, 02:16 PM | #1 |
Junior Member
Posts: 3
Karma: 10
Join Date: Aug 2022
Device: none
|
OutputFormatPlugin and file_type with modified.epub
Hello,
I am trying to write an OutputFormatPlugin that uses EPUBOutput to generate an epub, but it then modifies that epub slightly with some additional content. I have based my approach on the kepub output plugin and successfully developed the desired output. The output extension/format should be an epub. My current challenge is that I would like to generate an epub but not override the existing epub plugin, allowing the user to choose the existing epub plugin or a "modified epub" plugin, even though the output file would be an epub file with an epub extension (like "Mybook.epub/mobi" converted to "Mybook.modified.epub") All my code is running, but when developing the PluginWidget, I realized that the gui_configuration_widget method of my plugin does not get called when file_type has a dot in its string (ex: file_type = "modified.epub") To overcome this, I have attempted to "rename" the file before exiting the convert method, but without success. Any clue about alternative approaches? thank you |
10-07-2022, 09:32 PM | #2 |
creator of calibre
Posts: 44,017
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You override the builtin plugin and your plugin can add an option which the user can set to turn on its modifications or not.
|
Advert | |
|
10-08-2022, 01:54 AM | #3 | |
Junior Member
Posts: 3
Karma: 10
Join Date: Aug 2022
Device: none
|
Quote:
Thanks for taking the time to answer. Yes, that is an option, but it will overwrite an existing epub file, which I wanted to avoid - that's why I followed the kepub's plugin instead of overriding EPubOutout. Everything works, but gui_configuration_widget doesn't get called (it calls the Epub widget). Any additional clue? |
|
10-08-2022, 06:44 AM | #4 |
creator of calibre
Posts: 44,017
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
An outputformatplugin will not overwrite the epub it will store the original as original_epub (unless that feature is disabled ofcourse)
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Exporting modified epub don't appeared all corrected in Kobo Glo | jiembe | Library Management | 3 | 09-10-2018 09:01 AM |
Saving a modified epub in Sigil correctly | Gergely | ePub | 8 | 06-19-2018 07:04 AM |
The Guardian, modified | ajnorman | Recipes | 20 | 01-10-2014 11:02 AM |
problem when reading a modified ePub | jlg432 | Ectaco jetBook | 7 | 11-07-2010 10:11 AM |
Modified Cover | Mickey330 | PocketBook | 11 | 06-18-2010 05:49 AM |