Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 10-07-2022, 02:16 PM   #1
paparazzoreader
Junior Member
paparazzoreader began at the beginning.
 
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
paparazzoreader is offline   Reply With Quote
Old 10-07-2022, 09:32 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
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.
kovidgoyal is offline   Reply With Quote
Old 10-08-2022, 01:54 AM   #3
paparazzoreader
Junior Member
paparazzoreader began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Aug 2022
Device: none
Quote:
Originally Posted by kovidgoyal View Post
You override the builtin plugin and your plugin can add an option which the user can set to turn on its modifications or not.


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?
paparazzoreader is offline   Reply With Quote
Old 10-08-2022, 06:44 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
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)
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 03:58 PM.


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