View Single Post
Old 12-26-2012, 04:56 PM   #8
oblib__
Junior Member
oblib__ began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Aug 2012
Device: Smartphone
So I've been working on this off and on for a while now, and could use some more help. First off, it would be nice if a new type of plugin were created maybe called mid-processing or something. It would be called in the preprocess class (in preprocess.py) just before the final 'return html' in the __call__ function. The plugin would take in the html text, and return a modified html text. I would try and add it myself and submit my changes, but I'm having trouble running from source right now.

As a work around for now, I'm trying to write my plugin to do all the needed opening, modifying, and saving of the book contents, independent of type input type or output type. What is the easiest way to do that? I've tried grabbing relevant code from the plumber.py file, and can successfully create the oeb in a temp directory, but I decided rather than keep hacking at it once every couple of months, maybe it was time to ask for help.

So bottom line is that I'd like to write a plugin that can take any book format in, modify the contents of that book with my python script, and then return the modified contents for final creation by the rest of calibre processing. Thanks in advance!

Oh, and the reason I don't want to just modify and run from source -- I'd like to be able to do this on all my installations (both Linux and Windows) and keep on doing it though future versions without having to redownload and modify code. Basically I want Calibre to always be able to do this work for me, and if it's useful, share it with others.
oblib__ is offline   Reply With Quote